{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "日期：2020.10-11    \n",
    "更新日期：11月16号（更新内容）     \n",
    "撰写人：wgj  \n",
    "\n",
    "-----\n",
    "\n",
    "## 课堂学习内容：\n",
    "\n",
    "> * 1、高德API-WEB服务    \n",
    "> * 2、API经济成本的预估（调用量、并发量）   \n",
    "> * 3、地理编码/逆地理编码、路径规划、行政区域查询、POI搜索、ip定位、静态地图、天气查询、输入提示、交通态势\n",
    "\n",
    "...\n",
    "\n",
    "## 课后练习：\n",
    "\n",
    "> * 1、[地理编码](https://lbs.amap.com/api/webservice/guide/api/georegeo)   \n",
    "> * 2、[路径规划](http://lbs.amap.com/api/webservice/guide/api/direction) \n",
    "> * 3、[高德文档](https://lbs.amap.com/api/webservice/guide/api/georegeo)\n",
    "..."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 准备工作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests,json\n",
    "import pandas as pd\n",
    "key = \"dcf6ab6ec2715890c639887ab32bfc87\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 地理编码\n",
    "\n",
    "> * 1、结构化地址的定义： 首先，地址肯定是一串字符，内含国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦等建筑物名称。按照由大区域名称到小区域名称组合在一起的字符。一个有效的地址应该是独一无二的。注意：针对大陆、港、澳地区的地理编码转换时可以将国家信息选择性的忽略，但省、市、城镇等级别的地址构成是不能忽略的。暂时不支持返回台湾省的详细地址信息。    \n",
    "> * 2、url:https://restapi.amap.com/v3/geocode/geo?parameters      \n",
    "> * 3、requests.get()       \n",
    "> * 4、参数：   \n",
    "\n",
    ">> * A.必选：key（高德API秘钥），address(结构化地址)  \n",
    ">> * B.可选：city，batch，sig"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "#### 准备数据 请思考：高德API是怎么获取数据的？数据库查询\n",
    "中大南方_address = \"广东省广州市中山大学南方学院\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "params = {\n",
    "    \"key\":key,\n",
    "    \"address\":中大南方_address\n",
    "}\n",
    "# positional argument follows keyword argument\n",
    "# pa 一定要放在前面，keyword argument放在末尾！！！可以\n",
    "response = requests.get(url,params=params)\n",
    "response"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "中大南方_location = response.json()['geocodes'][0]['location']\n",
    "中大南方_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 203,
   "metadata": {},
   "outputs": [],
   "source": [
    "def geocode(key,address,city=None,batch=\"false\",sig=None,output=\"json\",callback=None):\n",
    "    \"\"\"将详细的结构化地址转换为高德经纬度坐标\"\"\"\n",
    "    geocode_url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"address\":address,\n",
    "        \"city\":city,\n",
    "        \"batch\":batch,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output,\n",
    "        \"callback\":callback\n",
    "    }\n",
    "    r = requests.get(geocode_url,params=params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 204,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'geocodes': [{'formatted_address': '广东省广州市从化区中山大学南方学院',\n",
       "   'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'citycode': '020',\n",
       "   'city': '广州市',\n",
       "   'district': '从化区',\n",
       "   'township': [],\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'adcode': '440117',\n",
       "   'street': [],\n",
       "   'number': [],\n",
       "   'location': '113.679287,23.632575',\n",
       "   'level': '兴趣点'}]}"
      ]
     },
     "execution_count": 204,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geocode(key, \"广东省广州市中山大学南方学院\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 逆地理编码\n",
    "\n",
    "> * A.url : https://restapi.amap.com/v3/geocode/regeo?parameters    \n",
    "> * B.requests.get()    \n",
    "> * C.参数：    \n",
    "\n",
    ">> * 1、必选：key,location(经纬度坐标)\n",
    ">> * 2、可选: extensions[(默认：base)可选\"all\",描述数据详细指数]，poitype，radius，batch，callback"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 205,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 逆地理编码函数\n",
    "def regeo(key,location,extensions=\"base\",radius=None,poitype=None):\n",
    "    \"\"\"\"\"\"\n",
    "    url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"location\":location,\n",
    "        \"extensions\":extensions,\n",
    "        \"radius\":radius,\n",
    "        \"poitype\":poitype\n",
    "    }\n",
    "    r = requests.get(url,params)\n",
    "    results = r.json()\n",
    "    return results\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 206,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'regeocode': {'formatted_address': [],\n",
       "  'addressComponent': {'country': [],\n",
       "   'province': [],\n",
       "   'city': [],\n",
       "   'citycode': [],\n",
       "   'district': [],\n",
       "   'adcode': [],\n",
       "   'township': [],\n",
       "   'towncode': [],\n",
       "   'streetNumber': {'street': [],\n",
       "    'number': [],\n",
       "    'location': '广东省广州市中山大学南方学院',\n",
       "    'direction': [],\n",
       "    'distance': []}},\n",
       "  'pois': [],\n",
       "  'roads': [],\n",
       "  'roadinters': [],\n",
       "  'aois': []}}"
      ]
     },
     "execution_count": 206,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "regeo(key, \"广东省广州市中山大学南方学院\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "params = {\n",
    "    \"key\":xu_key,\n",
    "    \"location\":中大南方_location,\n",
    "    \"extensions\":\"all\"\n",
    "}\n",
    "r = requests.get(url,params)\n",
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['博学路', '中山路', 'S29从莞深高速']"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_roads_ = [] # 创建个列表\n",
    "for item in r.json()['regeocode']['roads']:\n",
    "#     print(item['name'])\n",
    "    _roads_.append(item['name'])\n",
    "_roads_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'roads': [{'id': '020F49F0050461203',\n",
       "    'location': '113.68,23.634',\n",
       "    'direction': '南',\n",
       "    'name': '博学路',\n",
       "    'distance': '156.951'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'location': '113.677,23.6347',\n",
       "    'direction': '东南',\n",
       "    'name': '中山路',\n",
       "    'distance': '343.951'},\n",
       "   {'id': '020F49F006047765',\n",
       "    'location': '113.682,23.6394',\n",
       "    'direction': '南',\n",
       "    'name': 'S29从莞深高速',\n",
       "    'distance': '807.947'}],\n",
       "  'roadinters': [{'second_name': '中山路',\n",
       "    'first_id': '020F49F0050461203',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'distance': '343.951',\n",
       "    'first_name': '博学路',\n",
       "    'direction': '东南'}],\n",
       "  'formatted_address': '广东省广州市从化区温泉镇中山大学南方学院',\n",
       "  'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117103000',\n",
       "   'streetNumber': {'number': '7号',\n",
       "    'location': '113.678600,23.633329',\n",
       "    'direction': '西北',\n",
       "    'distance': '109.203',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [[]],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'aois': [{'area': '536585.849985',\n",
       "    'type': '141201',\n",
       "    'id': 'B00140MR9A',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'adcode': '440117',\n",
       "    'name': '中山大学南方学院',\n",
       "    'distance': '0'}],\n",
       "  'pois': [{'id': 'B00140MR9A',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'name': '中山大学南方学院',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'distance': '2.69979',\n",
       "    'tel': '020-61787331',\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFF2VMJ4',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道886号中山大学南方学院内',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院-综合楼',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'distance': '142.466',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFFTC9PH',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.193172',\n",
       "    'name': '中山大学南方学院教学楼10号',\n",
       "    'location': '113.680125,23.633492',\n",
       "    'distance': '132.988',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TQKX',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼6号',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'distance': '153.818',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B00141TQGR',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼7号',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'distance': '109.298',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B00141WQCO',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.14954',\n",
       "    'name': '中山大学南方学院教学楼8号',\n",
       "    'location': '113.680399,23.634329',\n",
       "    'distance': '225.543',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFG9IORM',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号中山大学南方学院内',\n",
       "    'poiweight': '0.287887',\n",
       "    'name': '中山大学南方学院-图书馆',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'distance': '23.6163',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'type': '科教文化服务;图书馆;图书馆'},\n",
       "   {'id': 'B0FFKP9EQJ',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院4号实验楼',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'distance': '69.4077',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJKIA10',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号中山大学南方学院',\n",
       "    'poiweight': '0.191691',\n",
       "    'name': '中山大学南方学院-第11教学楼',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'distance': '101.294',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TRVH',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路21',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼2号',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'distance': '264.846',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKERBQZ',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.289141',\n",
       "    'name': '中山大学南方学院惟贤门',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'distance': '154.082',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFKP81F4',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '政商研究院教学楼9号',\n",
       "    'location': '113.679949,23.633919',\n",
       "    'distance': '163.951',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP9ET5',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院1号实验楼',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'distance': '172.86',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TR76',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路29',\n",
       "    'poiweight': '0.052819',\n",
       "    'name': '中山大学南方学院教学楼4号',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'distance': '297.315',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP7Q5N',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院2号实验楼',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'distance': '210.76',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'direction': '南',\n",
       "    'businessarea': [],\n",
       "    'address': '笃行路2号',\n",
       "    'poiweight': '0.157653',\n",
       "    'name': '教工住宅1号',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'distance': '251.758',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0G3ARGF5Y',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.286321',\n",
       "    'name': '中山大学南方学院教学楼1号',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'distance': '241.753',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'name': '聚贤楼10号',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'distance': '263.444',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'distance': '263.674',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'distance': '275.62',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJLW0O9',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路4附近',\n",
       "    'poiweight': '0.191645',\n",
       "    'name': '中山大学南方学院西区饭堂',\n",
       "    'location': '113.676210,23.632177',\n",
       "    'distance': '316.572',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKPXMCN',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.191739',\n",
       "    'name': '中山大学南方学院音乐系',\n",
       "    'location': '113.678792,23.635389',\n",
       "    'distance': '316.942',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJBZLYT',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路与博学路交叉口东南50米',\n",
       "    'poiweight': '0.297382',\n",
       "    'name': '铜像广场',\n",
       "    'location': '113.676921,23.634555',\n",
       "    'distance': '326.444',\n",
       "    'tel': [],\n",
       "    'type': '风景名胜;风景名胜;风景名胜'},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'distance': '356.923',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFKPXO2S',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.188247',\n",
       "    'name': '中山大学南方学院医务室',\n",
       "    'location': '113.679394,23.635924',\n",
       "    'distance': '372.556',\n",
       "    'tel': [],\n",
       "    'type': '医疗保健服务;医疗保健服务场所;医疗保健服务场所'},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇温泉大道882号中大南方H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'distance': '331.438',\n",
       "    'tel': '020-61787222',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0FFHHLMF8',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山大学南方学院明辩路2号第三饭堂',\n",
       "    'poiweight': '0.178935',\n",
       "    'name': '茗语轩餐厅',\n",
       "    'location': '113.681901,23.634495',\n",
       "    'distance': '341.332',\n",
       "    'tel': '13929501395;13533390928',\n",
       "    'type': '餐饮服务;中餐厅;中餐厅'},\n",
       "   {'id': 'B0FFLJV996',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.286264',\n",
       "    'name': '保利桃花源66BLOCK',\n",
       "    'location': '113.682954,23.631008',\n",
       "    'distance': '412.208',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0FFKPXY26',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速公路',\n",
       "    'poiweight': '0.21826',\n",
       "    'name': '中山大学南方学院聚贤楼5号',\n",
       "    'location': '113.680265,23.636313',\n",
       "    'distance': '427.447',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;商务住宅相关;商务住宅相关'},\n",
       "   {'id': 'B0FFGXGN3K',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '中山大学南方学院',\n",
       "    'poiweight': '0.188657',\n",
       "    'name': '中山大学南方学院宿舍H25',\n",
       "    'location': '113.683474,23.632020',\n",
       "    'distance': '430.984',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'}]},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>direction</th>\n",
       "      <th>businessarea</th>\n",
       "      <th>address</th>\n",
       "      <th>poiweight</th>\n",
       "      <th>name</th>\n",
       "      <th>location</th>\n",
       "      <th>distance</th>\n",
       "      <th>tel</th>\n",
       "      <th>type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B00140MR9A</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882号</td>\n",
       "      <td>0.450402</td>\n",
       "      <td>中山大学南方学院</td>\n",
       "      <td>113.679262,23.632583</td>\n",
       "      <td>2.69979</td>\n",
       "      <td>020-61787331</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B0FFF2VMJ4</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道886号中山大学南方学院内</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院-综合楼</td>\n",
       "      <td>113.680117,23.631544</td>\n",
       "      <td>142.466</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B0FFFTC9PH</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速(中山大学南方学院)</td>\n",
       "      <td>0.193172</td>\n",
       "      <td>中山大学南方学院教学楼10号</td>\n",
       "      <td>113.680125,23.633492</td>\n",
       "      <td>132.988</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B00141TQKX</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院教学楼6号</td>\n",
       "      <td>113.678424,23.633710</td>\n",
       "      <td>153.818</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B00141TQGR</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路7</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院教学楼7号</td>\n",
       "      <td>113.678600,23.633330</td>\n",
       "      <td>109.298</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>B00141WQCO</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.14954</td>\n",
       "      <td>中山大学南方学院教学楼8号</td>\n",
       "      <td>113.680399,23.634329</td>\n",
       "      <td>225.543</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>B0FFG9IORM</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882号中山大学南方学院内</td>\n",
       "      <td>0.287887</td>\n",
       "      <td>中山大学南方学院-图书馆</td>\n",
       "      <td>113.679177,23.632762</td>\n",
       "      <td>23.6163</td>\n",
       "      <td>020-61787368;020-61787371</td>\n",
       "      <td>科教文化服务;图书馆;图书馆</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>B0FFKP9EQJ</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>中山大学南方学院4号实验楼</td>\n",
       "      <td>113.679963,23.632652</td>\n",
       "      <td>69.4077</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>B0FFJKIA10</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882号中山大学南方学院</td>\n",
       "      <td>0.191691</td>\n",
       "      <td>中山大学南方学院-第11教学楼</td>\n",
       "      <td>113.680037,23.633173</td>\n",
       "      <td>101.294</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>B00141TRVH</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路21</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院教学楼2号</td>\n",
       "      <td>113.677060,23.631346</td>\n",
       "      <td>264.846</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B0FFKERBQZ</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路7号附近</td>\n",
       "      <td>0.289141</td>\n",
       "      <td>中山大学南方学院惟贤门</td>\n",
       "      <td>113.678437,23.633721</td>\n",
       "      <td>154.082</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>B0FFKP81F4</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>政商研究院教学楼9号</td>\n",
       "      <td>113.679949,23.633919</td>\n",
       "      <td>163.951</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>B0FFKP9ET5</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>中山大学南方学院1号实验楼</td>\n",
       "      <td>113.678215,23.631370</td>\n",
       "      <td>172.86</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>B00141TR76</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路29</td>\n",
       "      <td>0.052819</td>\n",
       "      <td>中山大学南方学院教学楼4号</td>\n",
       "      <td>113.677460,23.630490</td>\n",
       "      <td>297.315</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>B0FFKP7Q5N</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>中山大学南方学院2号实验楼</td>\n",
       "      <td>113.678211,23.630956</td>\n",
       "      <td>210.76</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>B00140TWHT</td>\n",
       "      <td>南</td>\n",
       "      <td>[]</td>\n",
       "      <td>笃行路2号</td>\n",
       "      <td>0.157653</td>\n",
       "      <td>教工住宅1号</td>\n",
       "      <td>113.678490,23.630432</td>\n",
       "      <td>251.758</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>B0G3ARGF5Y</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.286321</td>\n",
       "      <td>中山大学南方学院教学楼1号</td>\n",
       "      <td>113.677077,23.631783</td>\n",
       "      <td>241.753</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>B0FFLBEOND</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速(中山大学南方学院)</td>\n",
       "      <td>0.190963</td>\n",
       "      <td>聚贤楼10号</td>\n",
       "      <td>113.681253,23.631036</td>\n",
       "      <td>263.444</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>B0FFKP81F0</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路19号附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>教学楼1号(文学与传媒学院)</td>\n",
       "      <td>113.676866,23.631736</td>\n",
       "      <td>263.674</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>B0FFKP838K</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路25</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>教学楼3号(外国语学院)</td>\n",
       "      <td>113.677247,23.630947</td>\n",
       "      <td>275.62</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>B0FFJLW0O9</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路4附近</td>\n",
       "      <td>0.191645</td>\n",
       "      <td>中山大学南方学院西区饭堂</td>\n",
       "      <td>113.676210,23.632177</td>\n",
       "      <td>316.572</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>B0FFKPXMCN</td>\n",
       "      <td>北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路</td>\n",
       "      <td>0.191739</td>\n",
       "      <td>中山大学南方学院音乐系</td>\n",
       "      <td>113.678792,23.635389</td>\n",
       "      <td>316.942</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>B0FFJBZLYT</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路与博学路交叉口东南50米</td>\n",
       "      <td>0.297382</td>\n",
       "      <td>铜像广场</td>\n",
       "      <td>113.676921,23.634555</td>\n",
       "      <td>326.444</td>\n",
       "      <td>[]</td>\n",
       "      <td>风景名胜;风景名胜;风景名胜</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>B0FFG8CSEK</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速(中山大学南方学院)</td>\n",
       "      <td>0.185371</td>\n",
       "      <td>L5员工宿舍</td>\n",
       "      <td>113.682583,23.631487</td>\n",
       "      <td>356.923</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>B0FFKPXO2S</td>\n",
       "      <td>北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.188247</td>\n",
       "      <td>中山大学南方学院医务室</td>\n",
       "      <td>113.679394,23.635924</td>\n",
       "      <td>372.556</td>\n",
       "      <td>[]</td>\n",
       "      <td>医疗保健服务;医疗保健服务场所;医疗保健服务场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>B0FFH6K3U9</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉镇温泉大道882号中大南方H7栋1-5层</td>\n",
       "      <td>0.254885</td>\n",
       "      <td>广州中大南方招待所</td>\n",
       "      <td>113.676330,23.631332</td>\n",
       "      <td>331.438</td>\n",
       "      <td>020-61787222</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>B0FFHHLMF8</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山大学南方学院明辩路2号第三饭堂</td>\n",
       "      <td>0.178935</td>\n",
       "      <td>茗语轩餐厅</td>\n",
       "      <td>113.681901,23.634495</td>\n",
       "      <td>341.332</td>\n",
       "      <td>13929501395;13533390928</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>B0FFLJV996</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.286264</td>\n",
       "      <td>保利桃花源66BLOCK</td>\n",
       "      <td>113.682954,23.631008</td>\n",
       "      <td>412.208</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>B0FFKPXY26</td>\n",
       "      <td>北</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速公路</td>\n",
       "      <td>0.21826</td>\n",
       "      <td>中山大学南方学院聚贤楼5号</td>\n",
       "      <td>113.680265,23.636313</td>\n",
       "      <td>427.447</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;商务住宅相关;商务住宅相关</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>B0FFGXGN3K</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山大学南方学院</td>\n",
       "      <td>0.188657</td>\n",
       "      <td>中山大学南方学院宿舍H25</td>\n",
       "      <td>113.683474,23.632020</td>\n",
       "      <td>430.984</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            id direction businessarea                 address poiweight  \\\n",
       "0   B00140MR9A         西           []                温泉大道882号  0.450402   \n",
       "1   B0FFF2VMJ4        东南           []       温泉大道886号中山大学南方学院内  0.148531   \n",
       "2   B0FFFTC9PH        东北           []         从莞深高速(中山大学南方学院)  0.193172   \n",
       "3   B00141TQKX        西北           []                 温泉大道882  0.148531   \n",
       "4   B00141TQGR        西北           []                    博学路7  0.148531   \n",
       "5   B00141WQCO        东北           []                     博学路   0.14954   \n",
       "6   B0FFG9IORM        西北           []       温泉大道882号中山大学南方学院内  0.287887   \n",
       "7   B0FFKP9EQJ         东           []                   博学路附近  0.191742   \n",
       "8   B0FFJKIA10        东北           []        温泉大道882号中山大学南方学院  0.191691   \n",
       "9   B00141TRVH        西南           []                   博学路21  0.148531   \n",
       "10  B0FFKERBQZ        西北           []                 博学路7号附近  0.289141   \n",
       "11  B0FFKP81F4        东北           []                     中山路  0.191742   \n",
       "12  B0FFKP9ET5        西南           []                   博学路附近  0.191742   \n",
       "13  B00141TR76        西南           []                   博学路29  0.052819   \n",
       "14  B0FFKP7Q5N        西南           []                     博学路  0.191742   \n",
       "15  B00140TWHT         南           []                   笃行路2号  0.157653   \n",
       "16  B0G3ARGF5Y         西           []                      []  0.286321   \n",
       "17  B0FFLBEOND        东南           []         从莞深高速(中山大学南方学院)  0.190963   \n",
       "18  B0FFKP81F0         西           []                博学路19号附近  0.191742   \n",
       "19  B0FFKP838K        西南           []                   博学路25  0.191742   \n",
       "20  B0FFJLW0O9         西           []                  博学路4附近  0.191645   \n",
       "21  B0FFKPXMCN         北           []                     中山路  0.191739   \n",
       "22  B0FFJBZLYT        西北           []         中山路与博学路交叉口东南50米  0.297382   \n",
       "23  B0FFG8CSEK         东           []         从莞深高速(中山大学南方学院)  0.185371   \n",
       "24  B0FFKPXO2S         北           []                   博学路附近  0.188247   \n",
       "25  B0FFH6K3U9        西南           []  温泉镇温泉大道882号中大南方H7栋1-5层  0.254885   \n",
       "26  B0FFHHLMF8        东北           []       中山大学南方学院明辩路2号第三饭堂  0.178935   \n",
       "27  B0FFLJV996        东南           []                      []  0.286264   \n",
       "28  B0FFKPXY26         北           []                 从莞深高速公路   0.21826   \n",
       "29  B0FFGXGN3K         东           []                中山大学南方学院  0.188657   \n",
       "\n",
       "               name              location distance                        tel  \\\n",
       "0          中山大学南方学院  113.679262,23.632583  2.69979               020-61787331   \n",
       "1      中山大学南方学院-综合楼  113.680117,23.631544  142.466                         []   \n",
       "2    中山大学南方学院教学楼10号  113.680125,23.633492  132.988                         []   \n",
       "3     中山大学南方学院教学楼6号  113.678424,23.633710  153.818                         []   \n",
       "4     中山大学南方学院教学楼7号  113.678600,23.633330  109.298                         []   \n",
       "5     中山大学南方学院教学楼8号  113.680399,23.634329  225.543                         []   \n",
       "6      中山大学南方学院-图书馆  113.679177,23.632762  23.6163  020-61787368;020-61787371   \n",
       "7     中山大学南方学院4号实验楼  113.679963,23.632652  69.4077                         []   \n",
       "8   中山大学南方学院-第11教学楼  113.680037,23.633173  101.294                         []   \n",
       "9     中山大学南方学院教学楼2号  113.677060,23.631346  264.846                         []   \n",
       "10      中山大学南方学院惟贤门  113.678437,23.633721  154.082                         []   \n",
       "11       政商研究院教学楼9号  113.679949,23.633919  163.951                         []   \n",
       "12    中山大学南方学院1号实验楼  113.678215,23.631370   172.86                         []   \n",
       "13    中山大学南方学院教学楼4号  113.677460,23.630490  297.315                         []   \n",
       "14    中山大学南方学院2号实验楼  113.678211,23.630956   210.76                         []   \n",
       "15           教工住宅1号  113.678490,23.630432  251.758                         []   \n",
       "16    中山大学南方学院教学楼1号  113.677077,23.631783  241.753                         []   \n",
       "17           聚贤楼10号  113.681253,23.631036  263.444                         []   \n",
       "18   教学楼1号(文学与传媒学院)  113.676866,23.631736  263.674                         []   \n",
       "19     教学楼3号(外国语学院)  113.677247,23.630947   275.62                         []   \n",
       "20     中山大学南方学院西区饭堂  113.676210,23.632177  316.572                         []   \n",
       "21      中山大学南方学院音乐系  113.678792,23.635389  316.942                         []   \n",
       "22             铜像广场  113.676921,23.634555  326.444                         []   \n",
       "23           L5员工宿舍  113.682583,23.631487  356.923                         []   \n",
       "24      中山大学南方学院医务室  113.679394,23.635924  372.556                         []   \n",
       "25        广州中大南方招待所  113.676330,23.631332  331.438               020-61787222   \n",
       "26            茗语轩餐厅  113.681901,23.634495  341.332    13929501395;13533390928   \n",
       "27     保利桃花源66BLOCK  113.682954,23.631008  412.208                         []   \n",
       "28    中山大学南方学院聚贤楼5号  113.680265,23.636313  427.447                         []   \n",
       "29    中山大学南方学院宿舍H25  113.683474,23.632020  430.984                         []   \n",
       "\n",
       "                        type  \n",
       "0             科教文化服务;学校;高等院校  \n",
       "1               科教文化服务;学校;学校  \n",
       "2       科教文化服务;科教文化场所;科教文化场所  \n",
       "3               科教文化服务;学校;学校  \n",
       "4             科教文化服务;学校;高等院校  \n",
       "5       科教文化服务;科教文化场所;科教文化场所  \n",
       "6             科教文化服务;图书馆;图书馆  \n",
       "7       科教文化服务;科教文化场所;科教文化场所  \n",
       "8       科教文化服务;科教文化场所;科教文化场所  \n",
       "9       科教文化服务;科教文化场所;科教文化场所  \n",
       "10            科教文化服务;学校;高等院校  \n",
       "11      科教文化服务;科教文化场所;科教文化场所  \n",
       "12      科教文化服务;科教文化场所;科教文化场所  \n",
       "13      科教文化服务;科教文化场所;科教文化场所  \n",
       "14      科教文化服务;科教文化场所;科教文化场所  \n",
       "15             商务住宅;住宅区;住宅小区  \n",
       "16            科教文化服务;学校;高等院校  \n",
       "17               商务住宅;住宅区;宿舍  \n",
       "18      科教文化服务;科教文化场所;科教文化场所  \n",
       "19      科教文化服务;科教文化场所;科教文化场所  \n",
       "20      科教文化服务;科教文化场所;科教文化场所  \n",
       "21      科教文化服务;科教文化场所;科教文化场所  \n",
       "22            风景名胜;风景名胜;风景名胜  \n",
       "23               商务住宅;住宅区;宿舍  \n",
       "24  医疗保健服务;医疗保健服务场所;医疗保健服务场所  \n",
       "25        住宿服务;住宿服务相关;住宿服务相关  \n",
       "26              餐饮服务;中餐厅;中餐厅  \n",
       "27             商务住宅;住宅区;住宅小区  \n",
       "28        商务住宅;商务住宅相关;商务住宅相关  \n",
       "29               商务住宅;住宅区;宿舍  "
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['regeocode']['pois'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 路径规划\n",
    "\n",
    "> * 1、步行\n",
    "> * 2、公交车\n",
    "> * 3、驾车"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 步行 \n",
    "\n",
    "> * 1、url:https://restapi.amap.com/v3/direction/walking?parameters    \n",
    "> * 2、requests.get()\n",
    "> * 3、参数：\n",
    "\n",
    ">> * A.必选：key，origin（出发点（经度，纬度））,destination（目的地（经度，纬度））\n",
    ">> * B.可选：sig，output，callback"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据准备： \n",
    "origin = \"广东省广州市中山大学南方学院\"\n",
    "destination = \"广州市从化区龙岗\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 思考：如果有1000个位置？重复代码？\n",
    "# 函数！？ -->1、节省代码，重复利用  2、可以给小白（会一点python）用！\n",
    "# 地理编码 =》 函数形式\n",
    "# 函数一定不会报错，哪怕你写的语法有错误，哪怕你写的参数没定义？-----> 函数只有在执行（调用）时才会真正意义的运行！\n",
    "\n",
    "def geocode(key,address,city=None,batch=None)->str:\n",
    "    \"\"\"获取高德API的地理编码\n",
    "    注释：key是指高德API的秘钥，请先去注册\n",
    "          address是指结构化地址，具体请查看：https://lbs.amap.com/api/webservice/guide/api/georegeo   \n",
    "    \"\"\"\n",
    "    url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"address\":address,\n",
    "        \"city\":city,\n",
    "        \"batch\":batch\n",
    "    }\n",
    "    response = requests.get(url,params=params)\n",
    "    results = response.json()['geocodes'][0]['location']\n",
    "    # 返回值\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "起始点_中大南方 = geocode(xu_key,origin)\n",
    "起始点_中大南方"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.668051,23.600869'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "目的地_龙岗 = geocode(xu_key,destination)\n",
    "目的地_龙岗"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 步行\n",
    "url = \"https://restapi.amap.com/v3/direction/walking?parameters\"\n",
    "params = {\n",
    "    \"key\":key,\n",
    "    \"origin\":起始点_中大南方,\n",
    "    \"destination\":目的地_龙岗\n",
    "}\n",
    "r = requests.get(url,params)\n",
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'distance': '4957',\n",
       "  'duration': '3966',\n",
       "  'steps': [{'instruction': '向东步行101米右转',\n",
       "    'orientation': '东',\n",
       "    'road': [],\n",
       "    'distance': '101',\n",
       "    'duration': '81',\n",
       "    'polyline': '113.679592,23.632491;113.680586,23.632522',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向南步行199米向右前方行走',\n",
       "    'orientation': '南',\n",
       "    'road': [],\n",
       "    'distance': '199',\n",
       "    'duration': '159',\n",
       "    'polyline': '113.680586,23.632522;113.680638,23.63214;113.680668,23.63174;113.680634,23.631541;113.68059,23.631437;113.68059,23.631437;113.680499,23.631241;113.680408,23.631094;113.680208,23.630842',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向西步行159米左转',\n",
       "    'orientation': '西',\n",
       "    'road': [],\n",
       "    'distance': '159',\n",
       "    'duration': '127',\n",
       "    'polyline': '113.680204,23.630838;113.680035,23.630773;113.680035,23.630773;113.679644,23.630638;113.679644,23.630638;113.679362,23.630521;113.679201,23.630473;113.679201,23.630473;113.679032,23.63043;113.679032,23.63043;113.67888,23.630404;113.67888,23.630404;113.678711,23.630365',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向南步行237米左转',\n",
       "    'orientation': '南',\n",
       "    'road': [],\n",
       "    'distance': '237',\n",
       "    'duration': '190',\n",
       "    'polyline': '113.678711,23.63036;113.678711,23.62934;113.678711,23.62934;113.678711,23.629193;113.678689,23.629084;113.678637,23.629023;113.678424,23.628902;113.678368,23.628841;113.678316,23.628724;113.678294,23.628611;113.678294,23.628611;113.678277,23.628372',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向南步行498米向右前方行走',\n",
       "    'orientation': '南',\n",
       "    'road': [],\n",
       "    'distance': '498',\n",
       "    'duration': '398',\n",
       "    'polyline': '113.678273,23.628368;113.678572,23.628338;113.678685,23.628307;113.678685,23.628307;113.678845,23.628234;113.679045,23.628073;113.679158,23.627964;113.679158,23.627964;113.679214,23.627869;113.679236,23.627778;113.67928,23.627526;113.679288,23.627322;113.679288,23.627322;113.679253,23.626853;113.679184,23.626623;113.679141,23.626497;113.679002,23.626259;113.678941,23.626176;113.678711,23.625977;113.67862,23.625864;113.678529,23.62572;113.678438,23.625191;113.678429,23.625056;113.678451,23.624939;113.678572,23.624657',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向西南步行722米左转',\n",
       "    'orientation': '西南',\n",
       "    'road': [],\n",
       "    'distance': '722',\n",
       "    'duration': '578',\n",
       "    'polyline': '113.678572,23.624653;113.678559,23.62451;113.678416,23.624323;113.678416,23.624323;113.677582,23.623793;113.676532,23.623346;113.676363,23.623255;113.676272,23.623151;113.676111,23.622834;113.676042,23.622739;113.67579,23.622483;113.675499,23.622279;113.675417,23.622174;113.675386,23.622088;113.675378,23.621836;113.675378,23.621836;113.675391,23.62161;113.675434,23.621476;113.675543,23.621359;113.675764,23.621181;113.675846,23.621089;113.675903,23.620994;113.675907,23.620855;113.675877,23.620725;113.675747,23.620547;113.675599,23.620373;113.675243,23.620013',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向东南步行412米向右前方行走',\n",
       "    'orientation': '东南',\n",
       "    'road': [],\n",
       "    'distance': '412',\n",
       "    'duration': '330',\n",
       "    'polyline': '113.675239,23.620009;113.67549,23.620013;113.675642,23.619991;113.675773,23.619948;113.676016,23.619796;113.676901,23.619193;113.677261,23.618785;113.678069,23.61783;113.678069,23.61783;113.678181,23.617656',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿乌土街向南步行1381米右转',\n",
       "    'orientation': '南',\n",
       "    'road': '乌土街',\n",
       "    'distance': '1381',\n",
       "    'duration': '1105',\n",
       "    'polyline': '113.678181,23.617652;113.678095,23.617205;113.678051,23.617075;113.677973,23.616923;113.677743,23.616558;113.677609,23.616289;113.677391,23.615816;113.677339,23.615668;113.67714,23.614826;113.677049,23.614323;113.676927,23.613359;113.676845,23.612786;113.676602,23.611489;113.676415,23.610438;113.676411,23.610265;113.676411,23.610265;113.676489,23.609848;113.676502,23.609622;113.676493,23.609236;113.676415,23.608746;113.676415,23.608485;113.67648,23.60819;113.67661,23.607734;113.676819,23.606736;113.676862,23.606541;113.676914,23.606415;113.677014,23.606254;113.677535,23.605673',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿乌土街向西南步行165米直行',\n",
       "    'orientation': '西南',\n",
       "    'road': '乌土街',\n",
       "    'distance': '165',\n",
       "    'duration': '132',\n",
       "    'polyline': '113.677535,23.605668;113.676988,23.605373;113.676402,23.605;113.676163,23.604887',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿934县道向西步行118米直行',\n",
       "    'orientation': '西',\n",
       "    'road': '934县道',\n",
       "    'distance': '118',\n",
       "    'duration': '94',\n",
       "    'polyline': '113.676159,23.604883;113.675799,23.604805;113.675508,23.604779;113.675508,23.604779;113.675013,23.60474',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿桃园东路向西南步行674米向右前方行走',\n",
       "    'orientation': '西南',\n",
       "    'road': '桃园东路',\n",
       "    'distance': '674',\n",
       "    'duration': '539',\n",
       "    'polyline': '113.675009,23.604735;113.674236,23.604683;113.673893,23.604618;113.673464,23.604492;113.673464,23.604492;113.67168,23.604006;113.671541,23.603958;113.671411,23.603854;113.671068,23.603472;113.670807,23.603264;113.670807,23.603264;113.670525,23.603073;113.6702,23.602904;113.6702,23.602904;113.670022,23.602795;113.670022,23.602795;113.669909,23.602682;113.669818,23.602517;113.669787,23.602413;113.669718,23.601901',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿桃园东路向西南步行247米右转',\n",
       "    'orientation': '西南',\n",
       "    'road': '桃园东路',\n",
       "    'distance': '247',\n",
       "    'duration': '198',\n",
       "    'polyline': '113.669714,23.601897;113.66964,23.601771;113.66964,23.601771;113.669488,23.601558;113.669488,23.601558;113.668789,23.600859;113.668663,23.600768;113.668663,23.600768;113.668442,23.600647;113.667947,23.600417',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿龙泉路向北步行44米到达目的地',\n",
       "    'orientation': '北',\n",
       "    'road': '龙泉路',\n",
       "    'distance': '44',\n",
       "    'duration': '35',\n",
       "    'polyline': '113.667943,23.600412;113.667812,23.600794',\n",
       "    'action': [],\n",
       "    'assistant_action': '到达目的地',\n",
       "    'walk_type': '0'}]}]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()['route']['paths']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instruction</th>\n",
       "      <th>orientation</th>\n",
       "      <th>road</th>\n",
       "      <th>distance</th>\n",
       "      <th>duration</th>\n",
       "      <th>polyline</th>\n",
       "      <th>action</th>\n",
       "      <th>assistant_action</th>\n",
       "      <th>walk_type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>向东步行101米右转</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>101</td>\n",
       "      <td>81</td>\n",
       "      <td>113.679592,23.632491;113.680586,23.632522</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>向南步行199米向右前方行走</td>\n",
       "      <td>南</td>\n",
       "      <td>[]</td>\n",
       "      <td>199</td>\n",
       "      <td>159</td>\n",
       "      <td>113.680586,23.632522;113.680638,23.63214;113.6...</td>\n",
       "      <td>向右前方行走</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>向西步行159米左转</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>159</td>\n",
       "      <td>127</td>\n",
       "      <td>113.680204,23.630838;113.680035,23.630773;113....</td>\n",
       "      <td>左转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>向南步行237米左转</td>\n",
       "      <td>南</td>\n",
       "      <td>[]</td>\n",
       "      <td>237</td>\n",
       "      <td>190</td>\n",
       "      <td>113.678711,23.63036;113.678711,23.62934;113.67...</td>\n",
       "      <td>左转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>向南步行498米向右前方行走</td>\n",
       "      <td>南</td>\n",
       "      <td>[]</td>\n",
       "      <td>498</td>\n",
       "      <td>398</td>\n",
       "      <td>113.678273,23.628368;113.678572,23.628338;113....</td>\n",
       "      <td>向右前方行走</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>向西南步行722米左转</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>722</td>\n",
       "      <td>578</td>\n",
       "      <td>113.678572,23.624653;113.678559,23.62451;113.6...</td>\n",
       "      <td>左转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>向东南步行412米向右前方行走</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>412</td>\n",
       "      <td>330</td>\n",
       "      <td>113.675239,23.620009;113.67549,23.620013;113.6...</td>\n",
       "      <td>向右前方行走</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>沿乌土街向南步行1381米右转</td>\n",
       "      <td>南</td>\n",
       "      <td>乌土街</td>\n",
       "      <td>1381</td>\n",
       "      <td>1105</td>\n",
       "      <td>113.678181,23.617652;113.678095,23.617205;113....</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>沿乌土街向西南步行165米直行</td>\n",
       "      <td>西南</td>\n",
       "      <td>乌土街</td>\n",
       "      <td>165</td>\n",
       "      <td>132</td>\n",
       "      <td>113.677535,23.605668;113.676988,23.605373;113....</td>\n",
       "      <td>直行</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>沿934县道向西步行118米直行</td>\n",
       "      <td>西</td>\n",
       "      <td>934县道</td>\n",
       "      <td>118</td>\n",
       "      <td>94</td>\n",
       "      <td>113.676159,23.604883;113.675799,23.604805;113....</td>\n",
       "      <td>直行</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>沿桃园东路向西南步行674米向右前方行走</td>\n",
       "      <td>西南</td>\n",
       "      <td>桃园东路</td>\n",
       "      <td>674</td>\n",
       "      <td>539</td>\n",
       "      <td>113.675009,23.604735;113.674236,23.604683;113....</td>\n",
       "      <td>向右前方行走</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>沿桃园东路向西南步行247米右转</td>\n",
       "      <td>西南</td>\n",
       "      <td>桃园东路</td>\n",
       "      <td>247</td>\n",
       "      <td>198</td>\n",
       "      <td>113.669714,23.601897;113.66964,23.601771;113.6...</td>\n",
       "      <td>右转</td>\n",
       "      <td>[]</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>沿龙泉路向北步行44米到达目的地</td>\n",
       "      <td>北</td>\n",
       "      <td>龙泉路</td>\n",
       "      <td>44</td>\n",
       "      <td>35</td>\n",
       "      <td>113.667943,23.600412;113.667812,23.600794</td>\n",
       "      <td>[]</td>\n",
       "      <td>到达目的地</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             instruction orientation   road distance duration  \\\n",
       "0             向东步行101米右转           东     []      101       81   \n",
       "1         向南步行199米向右前方行走           南     []      199      159   \n",
       "2             向西步行159米左转           西     []      159      127   \n",
       "3             向南步行237米左转           南     []      237      190   \n",
       "4         向南步行498米向右前方行走           南     []      498      398   \n",
       "5            向西南步行722米左转          西南     []      722      578   \n",
       "6        向东南步行412米向右前方行走          东南     []      412      330   \n",
       "7        沿乌土街向南步行1381米右转           南    乌土街     1381     1105   \n",
       "8        沿乌土街向西南步行165米直行          西南    乌土街      165      132   \n",
       "9       沿934县道向西步行118米直行           西  934县道      118       94   \n",
       "10  沿桃园东路向西南步行674米向右前方行走          西南   桃园东路      674      539   \n",
       "11      沿桃园东路向西南步行247米右转          西南   桃园东路      247      198   \n",
       "12      沿龙泉路向北步行44米到达目的地           北    龙泉路       44       35   \n",
       "\n",
       "                                             polyline  action  \\\n",
       "0           113.679592,23.632491;113.680586,23.632522      右转   \n",
       "1   113.680586,23.632522;113.680638,23.63214;113.6...  向右前方行走   \n",
       "2   113.680204,23.630838;113.680035,23.630773;113....      左转   \n",
       "3   113.678711,23.63036;113.678711,23.62934;113.67...      左转   \n",
       "4   113.678273,23.628368;113.678572,23.628338;113....  向右前方行走   \n",
       "5   113.678572,23.624653;113.678559,23.62451;113.6...      左转   \n",
       "6   113.675239,23.620009;113.67549,23.620013;113.6...  向右前方行走   \n",
       "7   113.678181,23.617652;113.678095,23.617205;113....      右转   \n",
       "8   113.677535,23.605668;113.676988,23.605373;113....      直行   \n",
       "9   113.676159,23.604883;113.675799,23.604805;113....      直行   \n",
       "10  113.675009,23.604735;113.674236,23.604683;113....  向右前方行走   \n",
       "11  113.669714,23.601897;113.66964,23.601771;113.6...      右转   \n",
       "12          113.667943,23.600412;113.667812,23.600794      []   \n",
       "\n",
       "   assistant_action walk_type  \n",
       "0                []         0  \n",
       "1                []         0  \n",
       "2                []         0  \n",
       "3                []         0  \n",
       "4                []         0  \n",
       "5                []         0  \n",
       "6                []         0  \n",
       "7                []         0  \n",
       "8                []         0  \n",
       "9                []         0  \n",
       "10               []         0  \n",
       "11               []         0  \n",
       "12            到达目的地         0  "
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['route']['paths'][0]['steps'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 207,
   "metadata": {},
   "outputs": [],
   "source": [
    "def walking(key,origin,destination,sig=None,output=\"json\",callback=None):\n",
    "    \"\"\"步行路径规划 API 可以规划100KM以内的步行通勤方案，并且返回通勤方案的数据\"\"\"\n",
    "    walking_url = \"https://restapi.amap.com/v3/direction/walking?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"origin\":origin,\n",
    "        \"destination\":destination,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output,\n",
    "        \"callback\":callback\n",
    "    }\n",
    "    r = requests.get(walking_url,params=params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 208,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'ok',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'route': {'origin': '113.271191,22.779995',\n",
       "  'destination': '113.292382,22.818665',\n",
       "  'paths': [{'distance': '6946',\n",
       "    'duration': '5557',\n",
       "    'steps': [{'instruction': '向东南步行5米左转',\n",
       "      'orientation': '东南',\n",
       "      'road': [],\n",
       "      'distance': '5',\n",
       "      'duration': '4',\n",
       "      'polyline': '113.271489,22.779913;113.271515,22.77987',\n",
       "      'action': '左转',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿滨河路向东步行477米向左前方行走',\n",
       "      'orientation': '东',\n",
       "      'road': '滨河路',\n",
       "      'distance': '477',\n",
       "      'duration': '382',\n",
       "      'polyline': '113.271515,22.779865;113.271988,22.780009;113.271988,22.780009;113.272535,22.780187;113.272535,22.780187;113.272956,22.780334;113.272956,22.780334;113.27319,22.780408;113.273403,22.780451;113.273624,22.780477;113.273624,22.780477;113.27365,22.780477;113.27365,22.780477;113.274115,22.780525;113.274115,22.780525;113.274128,22.780525;113.274128,22.780525;113.274991,22.78059;113.275282,22.780569;113.275547,22.780486;113.275547,22.780486;113.275898,22.780395;113.27605,22.780373',\n",
       "      'action': '向左前方行走',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿滨河路向东步行1090米右转',\n",
       "      'orientation': '东',\n",
       "      'road': '滨河路',\n",
       "      'distance': '1090',\n",
       "      'duration': '872',\n",
       "      'polyline': '113.27605,22.780369;113.27622,22.780395;113.276428,22.78046;113.276428,22.78046;113.276623,22.78053;113.276623,22.78053;113.276771,22.780586;113.277014,22.780625;113.277561,22.780634;113.277561,22.780634;113.279332,22.780551;113.279332,22.780551;113.280056,22.78053;113.280933,22.780469;113.280933,22.780469;113.282422,22.780347;113.282422,22.780347;113.2825,22.780339;113.2825,22.780339;113.283355,22.780265;113.283767,22.780243;113.284683,22.780308;113.284683,22.780308;113.284809,22.780326;113.284809,22.780326;113.285964,22.780438;113.285964,22.780438;113.286016,22.780443;113.286016,22.780443;113.286636,22.780499',\n",
       "      'action': '右转',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '步行46米左转',\n",
       "      'orientation': [],\n",
       "      'road': [],\n",
       "      'distance': '46',\n",
       "      'duration': '37',\n",
       "      'polyline': '113.286636,22.780499;113.286636,22.780447;113.286636,22.780447;113.286649,22.780339;113.286615,22.780339;113.286602,22.780464;113.286697,22.780477',\n",
       "      'action': '左转',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '20'},\n",
       "     {'instruction': '沿广珠公路向北步行1045米',\n",
       "      'orientation': '北',\n",
       "      'road': '广珠公路',\n",
       "      'distance': '1045',\n",
       "      'duration': '836',\n",
       "      'polyline': '113.286697,22.780477;113.285981,22.786528;113.285981,22.786528;113.28576,22.788416;113.285655,22.789423;113.285586,22.789865',\n",
       "      'action': [],\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿广珠公路向北步行331米向右前方行走',\n",
       "      'orientation': '北',\n",
       "      'road': '广珠公路',\n",
       "      'distance': '331',\n",
       "      'duration': '265',\n",
       "      'polyline': '113.285582,22.789865;113.285495,22.790673;113.285434,22.790981;113.285434,22.790981;113.285386,22.79122;113.285226,22.791849;113.285226,22.791849;113.285043,22.792409;113.284883,22.792786',\n",
       "      'action': '向右前方行走',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿兴顺路向东北步行28米直行',\n",
       "      'orientation': '东北',\n",
       "      'road': '兴顺路',\n",
       "      'distance': '28',\n",
       "      'duration': '22',\n",
       "      'polyline': '113.284878,22.792786;113.285,22.793016',\n",
       "      'action': '直行',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '步行34米右转',\n",
       "      'orientation': [],\n",
       "      'road': [],\n",
       "      'distance': '34',\n",
       "      'duration': '27',\n",
       "      'polyline': '113.285,22.793016;113.285187,22.793277',\n",
       "      'action': '右转',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '1'},\n",
       "     {'instruction': '沿广珠公路步行58米左转',\n",
       "      'orientation': [],\n",
       "      'road': '广珠公路',\n",
       "      'distance': '58',\n",
       "      'duration': '46',\n",
       "      'polyline': '113.285187,22.793277;113.28533,22.793264;113.285612,22.793394;113.285712,22.793355',\n",
       "      'action': '左转',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿兴顺路向东北步行20米向左前方行走',\n",
       "      'orientation': '东北',\n",
       "      'road': '兴顺路',\n",
       "      'distance': '20',\n",
       "      'duration': '16',\n",
       "      'polyline': '113.285712,22.793351;113.285885,22.793437',\n",
       "      'action': '向左前方行走',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿龙盘西路向东北步行31米向左前方行走',\n",
       "      'orientation': '东北',\n",
       "      'road': '龙盘西路',\n",
       "      'distance': '31',\n",
       "      'duration': '25',\n",
       "      'polyline': '113.285885,22.793437;113.285994,22.793576;113.286033,22.793659;113.286033,22.793659;113.286037,22.793689',\n",
       "      'action': '向左前方行走',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿龙盘西路向北步行1061米向左前方行走',\n",
       "      'orientation': '北',\n",
       "      'road': '龙盘西路',\n",
       "      'distance': '1061',\n",
       "      'duration': '849',\n",
       "      'polyline': '113.286037,22.793689;113.285938,22.793937;113.285938,22.793937;113.285677,22.794414;113.285677,22.794414;113.285273,22.795069;113.284974,22.795595;113.284974,22.795595;113.284944,22.795647;113.284944,22.795647;113.28487,22.795781;113.28477,22.79599;113.28464,22.796385;113.284579,22.796732;113.28457,22.797001;113.284575,22.797348;113.284605,22.797539;113.284696,22.797895;113.284696,22.797895;113.284805,22.798134;113.285026,22.798511;113.285026,22.798511;113.285816,22.79951;113.285816,22.79951;113.285872,22.799579;113.285872,22.799579;113.286832,22.800734;113.286832,22.800734;113.287496,22.801502;113.287496,22.801502;113.287574,22.801667;113.287587,22.801793;113.287587,22.801793;113.287747,22.801788;113.287747,22.801788;113.287865,22.801918',\n",
       "      'action': '向左前方行走',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '步行40米右转',\n",
       "      'orientation': [],\n",
       "      'road': [],\n",
       "      'distance': '40',\n",
       "      'duration': '32',\n",
       "      'polyline': '113.287865,22.801918;113.28783,22.802287',\n",
       "      'action': '右转',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '1'},\n",
       "     {'instruction': '沿宝林路步行41米向左前方行走',\n",
       "      'orientation': [],\n",
       "      'road': '宝林路',\n",
       "      'distance': '41',\n",
       "      'duration': '33',\n",
       "      'polyline': '113.287826,22.802287;113.28806,22.802305;113.28822,22.802331',\n",
       "      'action': '向左前方行走',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿龙盘北路向东北步行1081米左转',\n",
       "      'orientation': '东北',\n",
       "      'road': '龙盘北路',\n",
       "      'distance': '1081',\n",
       "      'duration': '865',\n",
       "      'polyline': '113.28822,22.802331;113.288793,22.803012;113.288924,22.803212;113.288924,22.803212;113.289093,22.80349;113.289345,22.803997;113.289557,22.804497;113.289557,22.804497;113.289596,22.804583;113.289596,22.804583;113.289939,22.805356;113.290165,22.805712;113.290395,22.806007;113.290777,22.806402;113.291059,22.806658;113.291359,22.806879;113.29161,22.807049;113.29161,22.807049;113.291845,22.807166;113.291845,22.807166;113.292157,22.807331;113.292496,22.807465;113.29322,22.807687;113.295399,22.808312;113.295681,22.808433',\n",
       "      'action': '左转',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿国泰路向北步行84米直行',\n",
       "      'orientation': '北',\n",
       "      'road': '国泰路',\n",
       "      'distance': '84',\n",
       "      'duration': '67',\n",
       "      'polyline': '113.295681,22.808433;113.29582,22.808989;113.29582,22.808989;113.295864,22.809175',\n",
       "      'action': '直行',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '沿迎宾路向北步行163米向右前方行走',\n",
       "      'orientation': '北',\n",
       "      'road': '迎宾路',\n",
       "      'distance': '163',\n",
       "      'duration': '130',\n",
       "      'polyline': '113.295864,22.809175;113.295959,22.809648;113.295959,22.809648;113.296094,22.810312;113.296094,22.810312;113.296194,22.810629',\n",
       "      'action': '向右前方行走',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '向东北步行202米向左前方行走',\n",
       "      'orientation': '东北',\n",
       "      'road': [],\n",
       "      'distance': '202',\n",
       "      'duration': '162',\n",
       "      'polyline': '113.296194,22.810629;113.296233,22.810668;113.296233,22.810668;113.296302,22.810734;113.296302,22.810734;113.296363,22.81079;113.296597,22.810859;113.296597,22.810859;113.297504,22.811723;113.297504,22.811723;113.297643,22.811853',\n",
       "      'action': '向左前方行走',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '步行1109米到达目的地',\n",
       "      'orientation': [],\n",
       "      'road': [],\n",
       "      'distance': '1109',\n",
       "      'duration': '887',\n",
       "      'polyline': '113.297643,22.811853;113.297652,22.812465;113.297674,22.812556;113.297669,22.812678;113.297609,22.812808;113.296862,22.813611;113.296719,22.813906;113.296701,22.814197;113.296766,22.814349;113.297092,22.814844;113.297127,22.814957;113.297105,22.815065;113.29694,22.815642;113.29694,22.816007;113.29694,22.816007;113.296892,22.81635;113.296688,22.816558;113.296411,22.816658;113.29628,22.816827;113.296332,22.81701;113.296354,22.817153;113.296354,22.817153;113.296467,22.81753;113.296467,22.817808;113.296467,22.817808;113.296467,22.817904;113.296398,22.818576;113.296389,22.81908;113.296367,22.819132;113.296367,22.819132;113.296337,22.819193;113.295868,22.819609;113.295764,22.819657;113.295764,22.819657;113.295582,22.819718;113.294887,22.819835;113.294887,22.819835;113.294444,22.819896;113.294444,22.819896',\n",
       "      'action': [],\n",
       "      'assistant_action': '到达目的地',\n",
       "      'walk_type': '0'}]}]}}"
      ]
     },
     "execution_count": 208,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "walking(key,'113.271191,22.779995','113.292382,22.818665')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "###  公交路径规划\n",
    "#### （路径规划（公交车）（暨南大学-->猎德））：\n",
    "\n",
    "> * 1. url:\thttps://restapi.amap.com/v3/direction/transit/integrated?parameters\n",
    "> * 2.requests.get()\n",
    "> * 3.参数：\n",
    "\n",
    ">> * a.必选：key,origin(出发点）、destination（目的地（经纬度））# 地理编码获取经纬度  、city(可选值：城市名称/citycode)\n",
    ">> * a.可选：city，cityd，extensions，strategy，nightflag，date\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import requests,json\n",
    "import geo\n",
    "key = \"dcf6ab6ec2715890c639887ab32bfc87\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "def bus(key,origin,destination,city):\n",
    "    bus_url = \"https://restapi.amap.com/v3/direction/transit/integrated?parameters\"\n",
    "    params ={\n",
    "        \"key\":key,\n",
    "        \"origin\":origin,\n",
    "        \"destination\":destination,\n",
    "        \"city\":city\n",
    "    }\n",
    "    r = requests.get(bus_url,params=params)\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "113.350961,23.131577\n",
      "113.336127,23.113409\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '5',\n",
       " 'route': {'origin': '113.350961,23.131577',\n",
       "  'destination': '113.336127,23.113409',\n",
       "  'distance': '3224',\n",
       "  'taxi_cost': '14',\n",
       "  'transits': [{'cost': '1.0',\n",
       "    'duration': '2605',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '1408',\n",
       "    'distance': '4611',\n",
       "    'missed': '1',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.345055,23.125912',\n",
       "       'distance': '1225',\n",
       "       'duration': '1050',\n",
       "       'steps': [{'instruction': '沿明湖南路步行143米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '143',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351013,23.131449;113.350510,23.131393;113.350166,23.131359;113.349617,23.131298',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真茹路步行456米右转',\n",
       "         'road': '真茹路',\n",
       "         'distance': '456',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349617,23.131294;113.349609,23.131102;113.349594,23.130243;113.349594,23.129940;113.349602,23.129696;113.349617,23.128382;113.349609,23.128311;113.349617,23.128256;113.349602,23.127144',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿忠信路步行164米左转',\n",
       "         'road': '忠信路',\n",
       "         'distance': '164',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349602,23.127140;113.349144,23.127136;113.348541,23.127123;113.347977,23.127117',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行115米右转',\n",
       "         'road': [],\n",
       "         'distance': '115',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347977,23.127113;113.347954,23.126619;113.347946,23.126467;113.347878,23.126076',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿黄埔大道西步行67米向右前方行走',\n",
       "         'road': '黄埔大道西',\n",
       "         'distance': '67',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347870,23.126072;113.347603,23.126112;113.347534,23.126116;113.347221,23.126137',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行125米左转',\n",
       "         'road': [],\n",
       "         'distance': '125',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347214,23.126137;113.347214,23.126160;113.346947,23.126177;113.346901,23.125681;113.346588,23.125698;113.346596,23.125776',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿黄埔大道西步行155米到达国防大厦',\n",
       "         'road': '黄埔大道西',\n",
       "         'distance': '155',\n",
       "         'duration': [],\n",
       "         'polyline': '113.346596,23.125772;113.346306,23.125793;113.346100,23.125816;113.345978,23.125834;113.345726,23.125860;113.345055,23.125912',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达国防大厦'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '国防大厦',\n",
       "          'id': '900000105872002',\n",
       "          'location': '113.344963,23.125919'},\n",
       "         'arrival_stop': {'name': '猎德码头',\n",
       "          'id': '900000105872006',\n",
       "          'location': '113.337082,23.112673'},\n",
       "         'name': '669路(金穗路总站(马场路口)--金穗路总站(马场路口))',\n",
       "         'id': '900000105872',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '3203',\n",
       "         'duration': '1399',\n",
       "         'polyline': '113.344963,23.125919;113.344961,23.125920;113.345725,23.125859;113.345977,23.125833;113.346102,23.125816;113.346306,23.125794;113.347248,23.125738;113.347444,23.125768;113.347708,23.125738;113.348134,23.125673;113.348650,23.125595;113.348906,23.125408;113.349297,23.125321;113.349839,23.125200;113.349718,23.124605;113.349596,23.124162;113.349510,23.123837;113.349510,23.123832;113.349384,23.123368;113.348611,23.120503;113.348533,23.120226;113.348537,23.120230;113.348534,23.120235;113.348534,23.120232;113.348198,23.118980;113.348000,23.118338;113.347816,23.117743;113.347725,23.117605;113.347633,23.117527;113.347450,23.117386;113.347382,23.117395;113.347153,23.117418;113.346390,23.117496;113.346389,23.117496;113.346124,23.117522;113.344839,23.117609;113.344674,23.117622;113.344132,23.117648;113.343767,23.117661;113.343459,23.117682;113.343268,23.117422;113.343264,23.117179;113.343268,23.117010;113.343260,23.115990;113.343242,23.115239;113.343229,23.114661;113.343216,23.113763;113.343203,23.113307;113.343186,23.112313;113.343095,23.112092;113.342947,23.111953;113.342856,23.111918;113.342522,23.111962;113.342066,23.112031;113.341801,23.112070;113.341805,23.112072;113.341141,23.112171;113.340675,23.112226;113.338737,23.112469;113.338371,23.112513;113.337975,23.112560;113.337082,23.112673',\n",
       "         'bustimetag': '2',\n",
       "         'start_time': [],\n",
       "         'end_time': [],\n",
       "         'via_num': '5',\n",
       "         'via_stops': [{'name': '跑马地花园',\n",
       "           'id': '900000105872016',\n",
       "           'location': '113.349510,23.123837'},\n",
       "          {'name': '骏逸苑',\n",
       "           'id': '900000105872003',\n",
       "           'location': '113.348533,23.120226'},\n",
       "          {'name': '花城大道',\n",
       "           'id': '900000105872004',\n",
       "           'location': '113.346390,23.117496'},\n",
       "          {'name': '马场南路',\n",
       "           'id': '900000105872015',\n",
       "           'location': '113.343242,23.115239'},\n",
       "          {'name': '临江大道东',\n",
       "           'id': '900000105872005',\n",
       "           'location': '113.341801,23.112070'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.337013,23.112679',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '183',\n",
       "       'duration': '156',\n",
       "       'steps': [{'instruction': '沿临江大道步行62米右转',\n",
       "         'road': '临江大道',\n",
       "         'distance': '62',\n",
       "         'duration': [],\n",
       "         'polyline': '113.337013,23.112679;113.336601,23.112730;113.336403,23.112764',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海文路步行83米左转',\n",
       "         'road': '海文路',\n",
       "         'distance': '83',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336403,23.112764;113.336441,23.113173;113.336418,23.113516',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行17米左转',\n",
       "         'road': [],\n",
       "         'distance': '17',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336418,23.113516;113.336327,23.113554;113.336258,23.113581',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '2.0',\n",
       "    'duration': '2776',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '1875',\n",
       "    'distance': '3660',\n",
       "    'missed': '1',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.343330,23.123077',\n",
       "       'distance': '1692',\n",
       "       'duration': '1450',\n",
       "       'steps': [{'instruction': '沿明湖南路步行143米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '143',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351013,23.131449;113.350510,23.131393;113.350166,23.131359;113.349617,23.131298',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真茹路步行456米右转',\n",
       "         'road': '真茹路',\n",
       "         'distance': '456',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349617,23.131294;113.349609,23.131102;113.349594,23.130243;113.349594,23.129940;113.349602,23.129696;113.349617,23.128382;113.349609,23.128311;113.349617,23.128256;113.349602,23.127144',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿忠信路步行164米左转',\n",
       "         'road': '忠信路',\n",
       "         'distance': '164',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349602,23.127140;113.349144,23.127136;113.348541,23.127123;113.347977,23.127117',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行115米右转',\n",
       "         'road': [],\n",
       "         'distance': '115',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347977,23.127113;113.347954,23.126619;113.347946,23.126467;113.347878,23.126076',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿黄埔大道西步行448米左转',\n",
       "         'road': '黄埔大道西',\n",
       "         'distance': '448',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347870,23.126072;113.347603,23.126112;113.347534,23.126116;113.347221,23.126137;113.346855,23.126163;113.346703,23.126177;113.346245,23.126198;113.345619,23.126232;113.344688,23.126293;113.344040,23.126341;113.343880,23.126354;113.343674,23.126375;113.343460,23.126389',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿马场路步行366米到达红线女中心',\n",
       "         'road': '马场路',\n",
       "         'distance': '366',\n",
       "         'duration': [],\n",
       "         'polyline': '113.343460,23.126389;113.343376,23.126038;113.343376,23.125919;113.343361,23.125494;113.343353,23.125139;113.343346,23.124201;113.343346,23.123955;113.343346,23.123476;113.343330,23.123077',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达红线女中心'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '红线女中心',\n",
       "          'id': '440100016237010',\n",
       "          'location': '113.343323,23.123074'},\n",
       "         'arrival_stop': {'name': '猎德码头',\n",
       "          'id': '440100016237014',\n",
       "          'location': '113.337013,23.112682'},\n",
       "         'name': '138路(东莞庄总站--五羊新城总站)',\n",
       "         'id': '440100016237',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '1785',\n",
       "         'duration': '1169',\n",
       "         'polyline': '113.343323,23.123074;113.343323,23.122465;113.343323,23.122135;113.343323,23.121876;113.343323,23.121498;113.343346,23.121321;113.343346,23.120838;113.343315,23.119480;113.343315,23.119381;113.343300,23.118837;113.343300,23.118729;113.343300,23.118732;113.343300,23.118729;113.343300,23.118616;113.343300,23.118425;113.343292,23.117977;113.343277,23.117701;113.343269,23.117422;113.343269,23.117178;113.343269,23.117008;113.343262,23.115990;113.343246,23.115242;113.343246,23.115238;113.343224,23.114662;113.343216,23.113762;113.343201,23.113306;113.343193,23.112373;113.343117,23.112127;113.343063,23.112062;113.342949,23.111954;113.342865,23.111908;113.342339,23.111992;113.342064,23.112032;113.341805,23.112072;113.341141,23.112171;113.340675,23.112226;113.338737,23.112469;113.338371,23.112513;113.337975,23.112560;113.337013,23.112682',\n",
       "         'bustimetag': '2',\n",
       "         'start_time': [],\n",
       "         'end_time': [],\n",
       "         'via_num': '3',\n",
       "         'via_stops': [{'name': '马场路中',\n",
       "           'id': '440100016237011',\n",
       "           'location': '113.343300,23.118729'},\n",
       "          {'name': '马场路南',\n",
       "           'id': '440100016237022',\n",
       "           'location': '113.343246,23.115242'},\n",
       "          {'name': '临江大道东',\n",
       "           'id': '440100016237013',\n",
       "           'location': '113.341805,23.112072'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.337013,23.112679',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '183',\n",
       "       'duration': '156',\n",
       "       'steps': [{'instruction': '沿临江大道步行62米右转',\n",
       "         'road': '临江大道',\n",
       "         'distance': '62',\n",
       "         'duration': [],\n",
       "         'polyline': '113.337013,23.112679;113.336601,23.112730;113.336403,23.112764',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海文路步行83米左转',\n",
       "         'road': '海文路',\n",
       "         'distance': '83',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336403,23.112764;113.336441,23.113173;113.336418,23.113516',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行17米左转',\n",
       "         'road': [],\n",
       "         'distance': '17',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336418,23.113516;113.336327,23.113554;113.336258,23.113581',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '2.0',\n",
       "    'duration': '2681',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '2125',\n",
       "    'distance': '3864',\n",
       "    'missed': '1',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.345093,23.126266',\n",
       "       'distance': '1160',\n",
       "       'duration': '994',\n",
       "       'steps': [{'instruction': '沿明湖南路步行143米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '143',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351013,23.131449;113.350510,23.131393;113.350166,23.131359;113.349617,23.131298',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真茹路步行456米右转',\n",
       "         'road': '真茹路',\n",
       "         'distance': '456',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349617,23.131294;113.349609,23.131102;113.349594,23.130243;113.349594,23.129940;113.349602,23.129696;113.349617,23.128382;113.349609,23.128311;113.349617,23.128256;113.349602,23.127144',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿忠信路步行164米左转',\n",
       "         'road': '忠信路',\n",
       "         'distance': '164',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349602,23.127140;113.349144,23.127136;113.348541,23.127123;113.347977,23.127117',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行115米右转',\n",
       "         'road': [],\n",
       "         'distance': '115',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347977,23.127113;113.347954,23.126619;113.347946,23.126467;113.347878,23.126076',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿黄埔大道西步行282米到达国防大厦',\n",
       "         'road': '黄埔大道西',\n",
       "         'distance': '282',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347870,23.126072;113.347603,23.126112;113.347534,23.126116;113.347221,23.126137;113.346855,23.126163;113.346703,23.126177;113.346245,23.126198;113.345619,23.126232;113.345093,23.126266',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达国防大厦'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '国防大厦',\n",
       "          'id': '440100017236025',\n",
       "          'location': '113.345039,23.126272'},\n",
       "         'arrival_stop': {'name': '珠江公园南门',\n",
       "          'id': '440100017236029',\n",
       "          'location': '113.335547,23.118342'},\n",
       "         'name': '901A路(天河智慧城核心区总站(高唐)--华成路总站)',\n",
       "         'id': '440100017236',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '1739',\n",
       "         'duration': '860',\n",
       "         'polyline': '113.345039,23.126272;113.344692,23.126293;113.344036,23.126341;113.343958,23.126345;113.343880,23.126354;113.343672,23.126376;113.343459,23.126389;113.343368,23.126029;113.343355,23.125135;113.343342,23.124193;113.343338,23.123950;113.343333,23.123472;113.343329,23.123273;113.343320,23.122457;113.343329,23.122135;113.343320,23.121875;113.343338,23.121567;113.343338,23.121319;113.343338,23.120838;113.343312,23.119479;113.343312,23.119379;113.343294,23.118837;113.343294,23.118737;113.343294,23.118615;113.343294,23.118424;113.343277,23.118021;113.343242,23.117930;113.343173,23.117839;113.342969,23.117713;113.342222,23.117765;113.342044,23.117778;113.342040,23.117778;113.341411,23.117817;113.340647,23.117904;113.340304,23.117934;113.339748,23.117990;113.339132,23.118047;113.338837,23.118077;113.335547,23.118342',\n",
       "         'bustimetag': '2',\n",
       "         'start_time': [],\n",
       "         'end_time': [],\n",
       "         'via_num': '3',\n",
       "         'via_stops': [{'name': '红线女中心',\n",
       "           'id': '440100017236026',\n",
       "           'location': '113.343329,23.123273'},\n",
       "          {'name': '马场路中',\n",
       "           'id': '440100017236027',\n",
       "           'location': '113.343294,23.118737'},\n",
       "          {'name': '花城大道东',\n",
       "           'id': '440100017236028',\n",
       "           'location': '113.342044,23.117778'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.335556,23.118341',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '965',\n",
       "       'duration': '827',\n",
       "       'steps': [{'instruction': '沿花城大道步行124米向右前方行走',\n",
       "         'road': '花城大道',\n",
       "         'distance': '124',\n",
       "         'duration': [],\n",
       "         'polyline': '113.335556,23.118341;113.335075,23.118382;113.334900,23.118399;113.334564,23.118420;113.334335,23.118443',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行29米左转',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '29',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334335,23.118443;113.334084,23.118559',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行23米左转',\n",
       "         'road': [],\n",
       "         'distance': '23',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334084,23.118559;113.333870,23.118477',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行24米向左前方行走',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '24',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333870,23.118473;113.333885,23.118259',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行31米右转',\n",
       "         'road': [],\n",
       "         'distance': '31',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333885,23.118256;113.334099,23.118055',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿花城大道步行29米向左前方行走',\n",
       "         'road': '花城大道',\n",
       "         'distance': '29',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334099,23.118052;113.334068,23.118025;113.333900,23.117851',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行375米左转',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '375',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333900,23.117847;113.333916,23.117365;113.333931,23.116741;113.333939,23.116358;113.333969,23.115152;113.333969,23.114449',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海月路步行167米右转',\n",
       "         'road': '海月路',\n",
       "         'distance': '167',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333969,23.114445;113.334137,23.114445;113.334671,23.114445;113.335442,23.114445;113.335617,23.114435',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行64米向左前方行走',\n",
       "         'road': [],\n",
       "         'distance': '64',\n",
       "         'duration': [],\n",
       "         'polyline': '113.335617,23.114431;113.335609,23.114105;113.335571,23.113850',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行78米右转',\n",
       "         'road': [],\n",
       "         'distance': '78',\n",
       "         'duration': [],\n",
       "         'polyline': '113.335571,23.113846;113.335602,23.113794;113.335678,23.113750;113.336151,23.113628;113.336258,23.113585',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '2.0',\n",
       "    'duration': '2776',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '2054',\n",
       "    'distance': '4869',\n",
       "    'missed': '1',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.351860,23.125507',\n",
       "       'distance': '1045',\n",
       "       'duration': '895',\n",
       "       'steps': [{'instruction': '沿明湖南路步行143米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '143',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351013,23.131449;113.350510,23.131393;113.350166,23.131359;113.349617,23.131298',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真茹路步行456米往前走',\n",
       "         'road': '真茹路',\n",
       "         'distance': '456',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349617,23.131294;113.349609,23.131102;113.349594,23.130243;113.349594,23.129940;113.349602,23.129696;113.349617,23.128382;113.349609,23.128311;113.349617,23.128256;113.349602,23.127144',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真如路步行132米左转',\n",
       "         'road': '真如路',\n",
       "         'distance': '132',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349602,23.127140;113.349609,23.127052;113.349617,23.127005;113.349625,23.126862;113.349655,23.126518;113.349678,23.126249;113.349693,23.126106;113.349693,23.126059;113.349709,23.125929',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真如东路步行165米右转',\n",
       "         'road': '真如东路',\n",
       "         'distance': '165',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349709,23.125925;113.350487,23.125790;113.350983,23.125769;113.351112,23.125803;113.351181,23.125841;113.351288,23.125908',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行69米往前走',\n",
       "         'road': [],\n",
       "         'distance': '69',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351288,23.125902;113.351341,23.125820;113.351486,23.125967;113.351601,23.125769;113.351715,23.125793',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行59米右转',\n",
       "         'road': [],\n",
       "         'distance': '59',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351715,23.125793;113.351852,23.125813;113.351936,23.125799;113.351967,23.125772;113.352028,23.125729;113.352043,23.125687;113.352066,23.125517',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米到达华侨医院(潭村)',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.352066,23.125513;113.351860,23.125507',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达华侨医院(潭村)'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '华侨医院(潭村)',\n",
       "          'id': '440100016300041',\n",
       "          'location': '113.351753,23.125460'},\n",
       "         'arrival_stop': {'name': '猎德',\n",
       "          'id': '440100016300031',\n",
       "          'location': '113.331944,23.118641'},\n",
       "         'name': '194路(华景新城总站--海珠广场总站(侨光西))',\n",
       "         'id': '440100016300',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '2815',\n",
       "         'duration': '1016',\n",
       "         'polyline': '113.351753,23.125460;113.351562,23.125319;113.351051,23.125387;113.350380,23.125525;113.348694,23.125820;113.348137,23.125938;113.347801,23.125998;113.347450,23.126015;113.347298,23.126011;113.346436,23.126080;113.346230,23.126215;113.346016,23.126221;113.345619,23.126234;113.344940,23.126276;113.344696,23.126293;113.344032,23.126343;113.343956,23.126347;113.343887,23.126354;113.343674,23.126375;113.343460,23.126389;113.343292,23.126406;113.343117,23.126415;113.342972,23.126425;113.342819,23.126431;113.342590,23.126450;113.342323,23.126467;113.341522,23.126520;113.340981,23.126549;113.340614,23.126549;113.340424,23.126524;113.339645,23.126579;113.339470,23.126593;113.338676,23.126657;113.338058,23.126684;113.337997,23.126694;113.337830,23.126694;113.337746,23.126766;113.337410,23.126793;113.336723,23.126844;113.336571,23.126858;113.335106,23.126966;113.334961,23.126976;113.334282,23.127014;113.334152,23.127022;113.333939,23.127035;113.333717,23.127045;113.333557,23.127001;113.333443,23.126953;113.333244,23.126808;113.333176,23.126722;113.333168,23.126398;113.333168,23.126221;113.333191,23.125843;113.333229,23.125433;113.333244,23.124969;113.333275,23.124340;113.333397,23.124149;113.333397,23.123707;113.333398,23.123707;113.333398,23.123672;113.333420,23.123225;113.333468,23.122452;113.333472,23.122092;113.333490,23.121697;113.333498,23.121115;113.333407,23.120955;113.333403,23.120812;113.333407,23.120430;113.333424,23.119865;113.333442,23.119492;113.333451,23.118945;113.333377,23.118850;113.333242,23.118715;113.332969,23.118542;113.331944,23.118637;113.331944,23.118641',\n",
       "         'bustimetag': '2',\n",
       "         'start_time': [],\n",
       "         'end_time': [],\n",
       "         'via_num': '3',\n",
       "         'via_stops': [{'name': '国防大厦',\n",
       "           'id': '440100016300009',\n",
       "           'location': '113.344940,23.126276'},\n",
       "          {'name': '石牌村',\n",
       "           'id': '440100016300010',\n",
       "           'location': '113.339645,23.126579'},\n",
       "          {'name': '猎德大道北站',\n",
       "           'id': '440100016300042',\n",
       "           'location': '113.333397,23.123707'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.331863,23.118647',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '1009',\n",
       "       'duration': '864',\n",
       "       'steps': [{'instruction': '沿花城大道步行220米右转',\n",
       "         'road': '花城大道',\n",
       "         'distance': '220',\n",
       "         'duration': [],\n",
       "         'polyline': '113.331863,23.118647;113.332527,23.118589;113.332848,23.118559;113.332870,23.118559;113.333130,23.118647;113.333260,23.118729;113.333473,23.118511;113.333870,23.118477',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行24米向左前方行走',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '24',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333870,23.118473;113.333885,23.118259',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行31米右转',\n",
       "         'road': [],\n",
       "         'distance': '31',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333885,23.118256;113.334099,23.118055',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿花城大道步行29米向左前方行走',\n",
       "         'road': '花城大道',\n",
       "         'distance': '29',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334099,23.118052;113.334068,23.118025;113.333900,23.117851',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行375米左转',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '375',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333900,23.117847;113.333916,23.117365;113.333931,23.116741;113.333939,23.116358;113.333969,23.115152;113.333969,23.114449',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海月路步行167米右转',\n",
       "         'road': '海月路',\n",
       "         'distance': '167',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333969,23.114445;113.334137,23.114445;113.334671,23.114445;113.335442,23.114445;113.335617,23.114435',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行64米向左前方行走',\n",
       "         'road': [],\n",
       "         'distance': '64',\n",
       "         'duration': [],\n",
       "         'polyline': '113.335617,23.114431;113.335609,23.114105;113.335571,23.113850',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行78米右转',\n",
       "         'road': [],\n",
       "         'distance': '78',\n",
       "         'duration': [],\n",
       "         'polyline': '113.335571,23.113846;113.335602,23.113794;113.335678,23.113750;113.336151,23.113628;113.336258,23.113585',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '3.0',\n",
       "    'duration': '2915',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '2878',\n",
       "    'distance': '7016',\n",
       "    'missed': '1',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.339600,23.134882',\n",
       "       'distance': '1705',\n",
       "       'duration': '1461',\n",
       "       'steps': [{'instruction': '沿明湖南路步行35米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '35',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351357,23.131479',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真如东路步行219米向右前方行走',\n",
       "         'road': '真如东路',\n",
       "         'distance': '219',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351357,23.131479;113.351288,23.132196;113.351280,23.132383;113.351265,23.132973;113.351242,23.133142;113.351219,23.133255;113.351105,23.133425',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真如东路步行311米右转',\n",
       "         'road': '真如东路',\n",
       "         'distance': '311',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351105,23.133425;113.351105,23.133646;113.350967,23.134319;113.350739,23.135208;113.350723,23.135242;113.350685,23.135265;113.350037,23.135382;113.349899,23.135382;113.349792,23.135382;113.349709,23.135386',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行25米左转',\n",
       "         'road': [],\n",
       "         'distance': '25',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349709,23.135386;113.349724,23.135477;113.349762,23.135612',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿中山大道西辅路步行48米往前走',\n",
       "         'road': '中山大道西辅路',\n",
       "         'distance': '48',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349762,23.135612;113.349297,23.135685',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿中山大道西步行389米往前走',\n",
       "         'road': '中山大道西',\n",
       "         'distance': '389',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349289,23.135685;113.347931,23.135933;113.347603,23.135994;113.347290,23.136055;113.347237,23.136068;113.346786,23.136150;113.345551,23.136272',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿天河路辅路步行510米左转',\n",
       "         'road': '天河路辅路',\n",
       "         'distance': '510',\n",
       "         'duration': [],\n",
       "         'polyline': '113.345543,23.136272;113.345161,23.136219;113.344955,23.136181;113.344780,23.136147;113.343987,23.135981;113.343697,23.135916;113.343346,23.135841;113.342941,23.135756;113.342758,23.135715;113.342560,23.135668;113.342316,23.135612;113.342033,23.135538;113.341805,23.135481;113.341431,23.135395;113.340897,23.135260;113.340675,23.135187;113.340637,23.135170',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行168米到达岗顶',\n",
       "         'road': [],\n",
       "         'distance': '168',\n",
       "         'duration': [],\n",
       "         'polyline': '113.340630,23.135174;113.340607,23.134878;113.340248,23.134731;113.340080,23.135078;113.339600,23.134882',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达岗顶'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '岗顶',\n",
       "          'id': '440100023034005',\n",
       "          'location': '113.339601,23.134880'},\n",
       "         'arrival_stop': {'name': '珠江新城',\n",
       "          'id': '440100023034008',\n",
       "          'location': '113.321206,23.119293'},\n",
       "         'name': '地铁3号线(天河客运站--番禺广场)',\n",
       "         'id': '440100023034',\n",
       "         'type': '地铁线路',\n",
       "         'distance': '3158',\n",
       "         'duration': '316',\n",
       "         'polyline': '113.339601,23.134880;113.338709,23.134517;113.338282,23.134328;113.338056,23.134226;113.337864,23.134149;113.337673,23.134069;113.337473,23.134001;113.337212,23.133924;113.336968,23.133861;113.336742,23.133806;113.336464,23.133743;113.335455,23.133493;113.334924,23.133353;113.334733,23.133305;113.334585,23.133277;113.334305,23.133216;113.333834,23.133138;113.333091,23.133116;113.332124,23.133135;113.331184,23.133151;113.330589,23.133198;113.328752,23.133418;113.328183,23.133479;113.327289,23.133514;113.326354,23.133514;113.325081,23.133547;113.324429,23.133601;113.323537,23.133645;113.322613,23.133645;113.322308,23.133591;113.321994,23.133405;113.321558,23.132971;113.321548,23.132550;113.321503,23.131138;113.321456,23.129680;113.321411,23.128625;113.321320,23.127081;113.321280,23.124987;113.321239,23.122875;113.321210,23.120814;113.321206,23.119293',\n",
       "         'bustimetag': '2',\n",
       "         'start_time': '0610',\n",
       "         'end_time': '2330',\n",
       "         'via_num': '2',\n",
       "         'via_stops': [{'name': '石牌桥',\n",
       "           'id': '440100023034006',\n",
       "           'location': '113.332124,23.133135'},\n",
       "          {'name': '体育西路',\n",
       "           'id': '440100023034007',\n",
       "           'location': '113.321503,23.131138'}]}]},\n",
       "      'entrance': {'name': 'D口', 'location': '113.340599,23.134874'},\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': [],\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '珠江新城',\n",
       "          'id': '440100023037014',\n",
       "          'location': '113.321206,23.119293'},\n",
       "         'arrival_stop': {'name': '猎德',\n",
       "          'id': '440100023037015',\n",
       "          'location': '113.332105,23.118539'},\n",
       "         'name': '地铁5号线(滘口--文冲)',\n",
       "         'id': '440100023037',\n",
       "         'type': '地铁线路',\n",
       "         'distance': '980',\n",
       "         'duration': '133',\n",
       "         'polyline': '113.321206,23.119293;113.322586,23.119290;113.324445,23.119121;113.326668,23.118952;113.329169,23.118750;113.331498,23.118582;113.332105,23.118539',\n",
       "         'bustimetag': '2',\n",
       "         'start_time': '0615',\n",
       "         'end_time': '2315',\n",
       "         'via_num': '0',\n",
       "         'via_stops': []}]},\n",
       "      'entrance': [],\n",
       "      'exit': {'name': 'B口', 'location': '113.332726,23.118099'},\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.332100,23.118532',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '1172',\n",
       "       'duration': '1004',\n",
       "       'steps': [{'instruction': '步行151米右转',\n",
       "         'road': [],\n",
       "         'distance': '151',\n",
       "         'duration': [],\n",
       "         'polyline': '113.332100,23.118532;113.332779,23.118494;113.332809,23.118494;113.332779,23.118095;113.332726,23.118099;113.332695,23.118359',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿花城大道步行22米向右前方行走',\n",
       "         'road': '花城大道',\n",
       "         'distance': '22',\n",
       "         'duration': [],\n",
       "         'polyline': '113.332687,23.118359;113.332909,23.118347',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行79米向右前方行走',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '79',\n",
       "         'duration': [],\n",
       "         'polyline': '113.332909,23.118341;113.333267,23.118065;113.333488,23.117851',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行298米右转',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '298',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333488,23.117847;113.333519,23.117331;113.333519,23.117266;113.333534,23.116875;113.333542,23.116472;113.333549,23.116064;113.333557,23.115938;113.333580,23.115339;113.333588,23.115129',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行25米向右前方行走',\n",
       "         'road': [],\n",
       "         'distance': '25',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333580,23.115126;113.333488,23.115126;113.333488,23.115269',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行81米右转',\n",
       "         'road': [],\n",
       "         'distance': '81',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333488,23.115269;113.334015,23.115820',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行32米往前走',\n",
       "         'road': [],\n",
       "         'distance': '32',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334015,23.115820;113.334076,23.115639;113.334122,23.115561',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行10米右转',\n",
       "         'road': [],\n",
       "         'distance': '10',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334122,23.115555;113.334198,23.115490',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行10米右转',\n",
       "         'road': [],\n",
       "         'distance': '10',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334198,23.115486;113.334282,23.115435',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行109米左转',\n",
       "         'road': [],\n",
       "         'distance': '109',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334282,23.115429;113.334244,23.115152;113.334145,23.114449',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海月路步行230米右转',\n",
       "         'road': '海月路',\n",
       "         'distance': '230',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334137,23.114445;113.334671,23.114445;113.335442,23.114445;113.335617,23.114435;113.336395,23.114305',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海文路步行87米右转',\n",
       "         'road': '海文路',\n",
       "         'distance': '87',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336395,23.114302;113.336395,23.114050;113.336418,23.113520',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行17米左转',\n",
       "         'road': [],\n",
       "         'distance': '17',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336418,23.113516;113.336327,23.113554;113.336258,23.113581',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]}]}}"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "origin = \"广东省广州市暨南大学\"\n",
    "location_orgin = geocode(key,origin)\n",
    "print(location_orgin)\n",
    "destination = \"广东省广州市猎德\"\n",
    "location_destination = geocode(key,destination)\n",
    "print(location_destination)\n",
    "city = \"广州\" \n",
    "results_bus =  bus(key,location_orgin,location_destination,city)\n",
    "results_bus"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'1.0.5'"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "pandas 处理时：{},\n",
    "1、当表格为一行时，可直接去列name\n",
    "2、当表格为多行时，去某一行（列表）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id</th>\n",
       "      <th>type</th>\n",
       "      <th>distance</th>\n",
       "      <th>duration</th>\n",
       "      <th>polyline</th>\n",
       "      <th>bustimetag</th>\n",
       "      <th>start_time</th>\n",
       "      <th>end_time</th>\n",
       "      <th>via_num</th>\n",
       "      <th>via_stops</th>\n",
       "      <th>departure_stop.name</th>\n",
       "      <th>departure_stop.id</th>\n",
       "      <th>departure_stop.location</th>\n",
       "      <th>arrival_stop.name</th>\n",
       "      <th>arrival_stop.id</th>\n",
       "      <th>arrival_stop.location</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>669路(金穗路总站(马场路口)--金穗路总站(马场路口))</td>\n",
       "      <td>900000105872</td>\n",
       "      <td>普通公交线路</td>\n",
       "      <td>3203</td>\n",
       "      <td>1399</td>\n",
       "      <td>113.344963,23.125919;113.344961,23.125920;113....</td>\n",
       "      <td>2</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>5</td>\n",
       "      <td>[{'name': '跑马地花园', 'id': '900000105872016', 'l...</td>\n",
       "      <td>国防大厦</td>\n",
       "      <td>900000105872002</td>\n",
       "      <td>113.344963,23.125919</td>\n",
       "      <td>猎德码头</td>\n",
       "      <td>900000105872006</td>\n",
       "      <td>113.337082,23.112673</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                             name            id    type distance duration  \\\n",
       "0  669路(金穗路总站(马场路口)--金穗路总站(马场路口))  900000105872  普通公交线路     3203     1399   \n",
       "\n",
       "                                            polyline bustimetag start_time  \\\n",
       "0  113.344963,23.125919;113.344961,23.125920;113....          2         []   \n",
       "\n",
       "  end_time via_num                                          via_stops  \\\n",
       "0       []       5  [{'name': '跑马地花园', 'id': '900000105872016', 'l...   \n",
       "\n",
       "  departure_stop.name departure_stop.id departure_stop.location  \\\n",
       "0                国防大厦   900000105872002    113.344963,23.125919   \n",
       "\n",
       "  arrival_stop.name  arrival_stop.id arrival_stop.location  \n",
       "0              猎德码头  900000105872006  113.337082,23.112673  "
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_669路_walking = pd.json_normalize(results_bus['route']['transits'][0]['segments'][0]['walking']['steps'])\n",
    "_669路_bus = pd.json_normalize(results_bus['route']['transits'][0]['segments'][0]['bus']['buslines'])\n",
    "_669路_walking\n",
    "_669路_bus"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id</th>\n",
       "      <th>location</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>跑马地花园</td>\n",
       "      <td>900000105872016</td>\n",
       "      <td>113.349510,23.123837</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>骏逸苑</td>\n",
       "      <td>900000105872003</td>\n",
       "      <td>113.348533,23.120226</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>花城大道</td>\n",
       "      <td>900000105872004</td>\n",
       "      <td>113.346390,23.117496</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>马场南路</td>\n",
       "      <td>900000105872015</td>\n",
       "      <td>113.343242,23.115239</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>临江大道东</td>\n",
       "      <td>900000105872005</td>\n",
       "      <td>113.341801,23.112070</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    name               id              location\n",
       "0  跑马地花园  900000105872016  113.349510,23.123837\n",
       "1    骏逸苑  900000105872003  113.348533,23.120226\n",
       "2   花城大道  900000105872004  113.346390,23.117496\n",
       "3   马场南路  900000105872015  113.343242,23.115239\n",
       "4  临江大道东  900000105872005  113.341801,23.112070"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_669路_bus_via_stops = pd.json_normalize(_669路_bus['via_stops'][0])\n",
    "_669路_bus_via_stops"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 行政区域查询"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "key = 'dcf6ab6ec2715890c639887ab32bfc87'\n",
    "keywords = '广东'\n",
    "subdistrict = '2'\n",
    "extensions = 'base'\n",
    "filter = 'adcode'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url = 'https://restapi.amap.com/v3/config/district?parameters'\n",
    "params = {\n",
    "    'key':key,\n",
    "    'keywords':keywords,\n",
    "    'subdistrict':subdistrict,\n",
    "    'extensions':extensions,\n",
    "    'filter':filter\n",
    "  \n",
    "}\n",
    "r = requests.get(url,params)\n",
    "r\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'suggestion': {'keywords': [], 'cities': []},\n",
       " 'districts': [{'citycode': [],\n",
       "   'adcode': '440000',\n",
       "   'name': '广东省',\n",
       "   'center': '113.280637,23.125178',\n",
       "   'level': 'province',\n",
       "   'districts': [{'citycode': '0754',\n",
       "     'adcode': '440500',\n",
       "     'name': '汕头市',\n",
       "     'center': '116.708463,23.37102',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0754',\n",
       "       'adcode': '440515',\n",
       "       'name': '澄海区',\n",
       "       'center': '116.76336,23.46844',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440514',\n",
       "       'name': '潮南区',\n",
       "       'center': '116.423607,23.249798',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440523',\n",
       "       'name': '南澳县',\n",
       "       'center': '117.027105,23.419562',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440512',\n",
       "       'name': '濠江区',\n",
       "       'center': '116.729528,23.279345',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440513',\n",
       "       'name': '潮阳区',\n",
       "       'center': '116.602602,23.262336',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440511',\n",
       "       'name': '金平区',\n",
       "       'center': '116.703583,23.367071',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440507',\n",
       "       'name': '龙湖区',\n",
       "       'center': '116.732015,23.373754',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0757',\n",
       "     'adcode': '440600',\n",
       "     'name': '佛山市',\n",
       "     'center': '113.122717,23.028762',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0757',\n",
       "       'adcode': '440607',\n",
       "       'name': '三水区',\n",
       "       'center': '112.899414,23.16504',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0757',\n",
       "       'adcode': '440608',\n",
       "       'name': '高明区',\n",
       "       'center': '112.882123,22.893855',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0757',\n",
       "       'adcode': '440606',\n",
       "       'name': '顺德区',\n",
       "       'center': '113.281826,22.75851',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0757',\n",
       "       'adcode': '440605',\n",
       "       'name': '南海区',\n",
       "       'center': '113.145577,23.031562',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0757',\n",
       "       'adcode': '440604',\n",
       "       'name': '禅城区',\n",
       "       'center': '113.112414,23.019643',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0758',\n",
       "     'adcode': '441200',\n",
       "     'name': '肇庆市',\n",
       "     'center': '112.472529,23.051546',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0758',\n",
       "       'adcode': '441224',\n",
       "       'name': '怀集县',\n",
       "       'center': '112.182466,23.913072',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441225',\n",
       "       'name': '封开县',\n",
       "       'center': '111.502973,23.434731',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441223',\n",
       "       'name': '广宁县',\n",
       "       'center': '112.440419,23.631486',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441284',\n",
       "       'name': '四会市',\n",
       "       'center': '112.695028,23.340324',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441226',\n",
       "       'name': '德庆县',\n",
       "       'center': '111.78156,23.141711',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441203',\n",
       "       'name': '鼎湖区',\n",
       "       'center': '112.565249,23.155822',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441202',\n",
       "       'name': '端州区',\n",
       "       'center': '112.472329,23.052662',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441204',\n",
       "       'name': '高要区',\n",
       "       'center': '112.460846,23.027694',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0752',\n",
       "     'adcode': '441300',\n",
       "     'name': '惠州市',\n",
       "     'center': '114.412599,23.079404',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0752',\n",
       "       'adcode': '441324',\n",
       "       'name': '龙门县',\n",
       "       'center': '114.259986,23.723894',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0752',\n",
       "       'adcode': '441323',\n",
       "       'name': '惠东县',\n",
       "       'center': '114.723092,22.983036',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0752',\n",
       "       'adcode': '441322',\n",
       "       'name': '博罗县',\n",
       "       'center': '114.284254,23.167575',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0752',\n",
       "       'adcode': '441303',\n",
       "       'name': '惠阳区',\n",
       "       'center': '114.469444,22.78851',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0752',\n",
       "       'adcode': '441302',\n",
       "       'name': '惠城区',\n",
       "       'center': '114.413978,23.079883',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0755',\n",
       "     'adcode': '440300',\n",
       "     'name': '深圳市',\n",
       "     'center': '114.085947,22.547',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0755',\n",
       "       'adcode': '440306',\n",
       "       'name': '宝安区',\n",
       "       'center': '113.828671,22.754741',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440305',\n",
       "       'name': '南山区',\n",
       "       'center': '113.92943,22.531221',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440304',\n",
       "       'name': '福田区',\n",
       "       'center': '114.05096,22.541009',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440308',\n",
       "       'name': '盐田区',\n",
       "       'center': '114.235366,22.555069',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440303',\n",
       "       'name': '罗湖区',\n",
       "       'center': '114.123885,22.555341',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440310',\n",
       "       'name': '坪山区',\n",
       "       'center': '114.338441,22.69423',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440307',\n",
       "       'name': '龙岗区',\n",
       "       'center': '114.251372,22.721511',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440309',\n",
       "       'name': '龙华区',\n",
       "       'center': '114.044346,22.691963',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440311',\n",
       "       'name': '光明区',\n",
       "       'center': '113.935895,22.748816',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0759',\n",
       "     'adcode': '440800',\n",
       "     'name': '湛江市',\n",
       "     'center': '110.364977,21.274898',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0759',\n",
       "       'adcode': '440881',\n",
       "       'name': '廉江市',\n",
       "       'center': '110.284961,21.611281',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440883',\n",
       "       'name': '吴川市',\n",
       "       'center': '110.780508,21.428453',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440825',\n",
       "       'name': '徐闻县',\n",
       "       'center': '110.175718,20.326083',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440882',\n",
       "       'name': '雷州市',\n",
       "       'center': '110.088275,20.908523',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440811',\n",
       "       'name': '麻章区',\n",
       "       'center': '110.329167,21.265997',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440804',\n",
       "       'name': '坡头区',\n",
       "       'center': '110.455632,21.24441',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440803',\n",
       "       'name': '霞山区',\n",
       "       'center': '110.406382,21.194229',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440823',\n",
       "       'name': '遂溪县',\n",
       "       'center': '110.255321,21.376915',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440802',\n",
       "       'name': '赤坎区',\n",
       "       'center': '110.361634,21.273365',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0756',\n",
       "     'adcode': '440400',\n",
       "     'name': '珠海市',\n",
       "     'center': '113.553986,22.224979',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0756',\n",
       "       'adcode': '440403',\n",
       "       'name': '斗门区',\n",
       "       'center': '113.297739,22.209117',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0756',\n",
       "       'adcode': '440404',\n",
       "       'name': '金湾区',\n",
       "       'center': '113.345071,22.139122',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0756',\n",
       "       'adcode': '440402',\n",
       "       'name': '香洲区',\n",
       "       'center': '113.55027,22.271249',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0768',\n",
       "     'adcode': '445100',\n",
       "     'name': '潮州市',\n",
       "     'center': '116.632301,23.661701',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0768',\n",
       "       'adcode': '445122',\n",
       "       'name': '饶平县',\n",
       "       'center': '117.00205,23.668171',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0768',\n",
       "       'adcode': '445102',\n",
       "       'name': '湘桥区',\n",
       "       'center': '116.63365,23.664675',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0768',\n",
       "       'adcode': '445103',\n",
       "       'name': '潮安区',\n",
       "       'center': '116.67931,23.461012',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0668',\n",
       "     'adcode': '440900',\n",
       "     'name': '茂名市',\n",
       "     'center': '110.919229,21.659751',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0668',\n",
       "       'adcode': '440983',\n",
       "       'name': '信宜市',\n",
       "       'center': '110.941656,22.352681',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0668',\n",
       "       'adcode': '440981',\n",
       "       'name': '高州市',\n",
       "       'center': '110.853251,21.915153',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0668',\n",
       "       'adcode': '440982',\n",
       "       'name': '化州市',\n",
       "       'center': '110.63839,21.654953',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0668',\n",
       "       'adcode': '440904',\n",
       "       'name': '电白区',\n",
       "       'center': '111.007264,21.507219',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0668',\n",
       "       'adcode': '440902',\n",
       "       'name': '茂南区',\n",
       "       'center': '110.920542,21.660425',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0750',\n",
       "     'adcode': '440700',\n",
       "     'name': '江门市',\n",
       "     'center': '113.094942,22.590431',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0750',\n",
       "       'adcode': '440784',\n",
       "       'name': '鹤山市',\n",
       "       'center': '112.961795,22.768104',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440704',\n",
       "       'name': '江海区',\n",
       "       'center': '113.120601,22.572211',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440783',\n",
       "       'name': '开平市',\n",
       "       'center': '112.692262,22.366286',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440781',\n",
       "       'name': '台山市',\n",
       "       'center': '112.793414,22.250713',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440785',\n",
       "       'name': '恩平市',\n",
       "       'center': '112.314051,22.182956',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440705',\n",
       "       'name': '新会区',\n",
       "       'center': '113.038584,22.520247',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440703',\n",
       "       'name': '蓬江区',\n",
       "       'center': '113.07859,22.59677',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0762',\n",
       "     'adcode': '441600',\n",
       "     'name': '河源市',\n",
       "     'center': '114.697802,23.746266',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0762',\n",
       "       'adcode': '441624',\n",
       "       'name': '和平县',\n",
       "       'center': '114.941473,24.44318',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441622',\n",
       "       'name': '龙川县',\n",
       "       'center': '115.256415,24.101174',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441623',\n",
       "       'name': '连平县',\n",
       "       'center': '114.495952,24.364227',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441625',\n",
       "       'name': '东源县',\n",
       "       'center': '114.742711,23.789093',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441602',\n",
       "       'name': '源城区',\n",
       "       'center': '114.696828,23.746255',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441621',\n",
       "       'name': '紫金县',\n",
       "       'center': '115.184383,23.633744',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0766',\n",
       "     'adcode': '445300',\n",
       "     'name': '云浮市',\n",
       "     'center': '112.044439,22.929801',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0766',\n",
       "       'adcode': '445322',\n",
       "       'name': '郁南县',\n",
       "       'center': '111.535921,23.237709',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0766',\n",
       "       'adcode': '445381',\n",
       "       'name': '罗定市',\n",
       "       'center': '111.578201,22.765415',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0766',\n",
       "       'adcode': '445321',\n",
       "       'name': '新兴县',\n",
       "       'center': '112.23083,22.703204',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0766',\n",
       "       'adcode': '445302',\n",
       "       'name': '云城区',\n",
       "       'center': '112.04471,22.930827',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0766',\n",
       "       'adcode': '445303',\n",
       "       'name': '云安区',\n",
       "       'center': '112.005609,23.073152',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0660',\n",
       "     'adcode': '441500',\n",
       "     'name': '汕尾市',\n",
       "     'center': '115.364238,22.774485',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0660',\n",
       "       'adcode': '441521',\n",
       "       'name': '海丰县',\n",
       "       'center': '115.337324,22.971042',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0660',\n",
       "       'adcode': '441523',\n",
       "       'name': '陆河县',\n",
       "       'center': '115.657565,23.302682',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0660',\n",
       "       'adcode': '441581',\n",
       "       'name': '陆丰市',\n",
       "       'center': '115.644203,22.946104',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0660',\n",
       "       'adcode': '441502',\n",
       "       'name': '城区',\n",
       "       'center': '115.363667,22.776227',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0662',\n",
       "     'adcode': '441700',\n",
       "     'name': '阳江市',\n",
       "     'center': '111.975107,21.859222',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0662',\n",
       "       'adcode': '441781',\n",
       "       'name': '阳春市',\n",
       "       'center': '111.7905,22.169598',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0662',\n",
       "       'adcode': '441702',\n",
       "       'name': '江城区',\n",
       "       'center': '111.968909,21.859182',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0662',\n",
       "       'adcode': '441721',\n",
       "       'name': '阳西县',\n",
       "       'center': '111.617556,21.75367',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0662',\n",
       "       'adcode': '441704',\n",
       "       'name': '阳东区',\n",
       "       'center': '112.011267,21.864728',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0663',\n",
       "     'adcode': '445200',\n",
       "     'name': '揭阳市',\n",
       "     'center': '116.355733,23.543778',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0663',\n",
       "       'adcode': '445281',\n",
       "       'name': '普宁市',\n",
       "       'center': '116.165082,23.29788',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0663',\n",
       "       'adcode': '445222',\n",
       "       'name': '揭西县',\n",
       "       'center': '115.838708,23.4273',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0663',\n",
       "       'adcode': '445224',\n",
       "       'name': '惠来县',\n",
       "       'center': '116.295832,23.029834',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0663',\n",
       "       'adcode': '445203',\n",
       "       'name': '揭东区',\n",
       "       'center': '116.412947,23.569887',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0663',\n",
       "       'adcode': '445202',\n",
       "       'name': '榕城区',\n",
       "       'center': '116.357045,23.535524',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0753',\n",
       "     'adcode': '441400',\n",
       "     'name': '梅州市',\n",
       "     'center': '116.117582,24.299112',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0753',\n",
       "       'adcode': '441427',\n",
       "       'name': '蕉岭县',\n",
       "       'center': '116.170531,24.653313',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441426',\n",
       "       'name': '平远县',\n",
       "       'center': '115.891729,24.569651',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441481',\n",
       "       'name': '兴宁市',\n",
       "       'center': '115.731648,24.138077',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441424',\n",
       "       'name': '五华县',\n",
       "       'center': '115.775004,23.925424',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441423',\n",
       "       'name': '丰顺县',\n",
       "       'center': '116.184419,23.752771',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441422',\n",
       "       'name': '大埔县',\n",
       "       'center': '116.69552,24.351587',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441403',\n",
       "       'name': '梅县区',\n",
       "       'center': '116.083482,24.267825',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441402',\n",
       "       'name': '梅江区',\n",
       "       'center': '116.12116,24.302593',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '020',\n",
       "     'adcode': '440100',\n",
       "     'name': '广州市',\n",
       "     'center': '113.280637,23.125178',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '020',\n",
       "       'adcode': '440117',\n",
       "       'name': '从化区',\n",
       "       'center': '113.587386,23.545283',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440115',\n",
       "       'name': '南沙区',\n",
       "       'center': '113.53738,22.794531',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440114',\n",
       "       'name': '花都区',\n",
       "       'center': '113.211184,23.39205',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440111',\n",
       "       'name': '白云区',\n",
       "       'center': '113.262831,23.162281',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440113',\n",
       "       'name': '番禺区',\n",
       "       'center': '113.364619,22.938582',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440103',\n",
       "       'name': '荔湾区',\n",
       "       'center': '113.243038,23.124943',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440105',\n",
       "       'name': '海珠区',\n",
       "       'center': '113.262008,23.103131',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440118',\n",
       "       'name': '增城区',\n",
       "       'center': '113.829579,23.290497',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440104',\n",
       "       'name': '越秀区',\n",
       "       'center': '113.280714,23.125624',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440112',\n",
       "       'name': '黄埔区',\n",
       "       'center': '113.450761,23.103239',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440106',\n",
       "       'name': '天河区',\n",
       "       'center': '113.335367,23.13559',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0751',\n",
       "     'adcode': '440200',\n",
       "     'name': '韶关市',\n",
       "     'center': '113.591544,24.801322',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0751',\n",
       "       'adcode': '440222',\n",
       "       'name': '始兴县',\n",
       "       'center': '114.067205,24.948364',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440282',\n",
       "       'name': '南雄市',\n",
       "       'center': '114.311231,25.115328',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440204',\n",
       "       'name': '浈江区',\n",
       "       'center': '113.599224,24.803977',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440224',\n",
       "       'name': '仁化县',\n",
       "       'center': '113.748627,25.088226',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440232',\n",
       "       'name': '乳源瑶族自治县',\n",
       "       'center': '113.278417,24.776109',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440229',\n",
       "       'name': '翁源县',\n",
       "       'center': '114.131289,24.353887',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440205',\n",
       "       'name': '曲江区',\n",
       "       'center': '113.605582,24.680195',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440203',\n",
       "       'name': '武江区',\n",
       "       'center': '113.588289,24.80016',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440233',\n",
       "       'name': '新丰县',\n",
       "       'center': '114.207034,24.055412',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440281',\n",
       "       'name': '乐昌市',\n",
       "       'center': '113.352413,25.128445',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0763',\n",
       "     'adcode': '441800',\n",
       "     'name': '清远市',\n",
       "     'center': '113.051227,23.685022',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0763',\n",
       "       'adcode': '441882',\n",
       "       'name': '连州市',\n",
       "       'center': '112.379271,24.783966',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441825',\n",
       "       'name': '连山壮族瑶族自治县',\n",
       "       'center': '112.086555,24.567271',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441826',\n",
       "       'name': '连南瑶族自治县',\n",
       "       'center': '112.290808,24.719097',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441881',\n",
       "       'name': '英德市',\n",
       "       'center': '113.405404,24.18612',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441821',\n",
       "       'name': '佛冈县',\n",
       "       'center': '113.534094,23.866739',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441823',\n",
       "       'name': '阳山县',\n",
       "       'center': '112.634019,24.470286',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441803',\n",
       "       'name': '清新区',\n",
       "       'center': '113.015203,23.736949',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441802',\n",
       "       'name': '清城区',\n",
       "       'center': '113.048698,23.688976',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0760',\n",
       "     'adcode': '442000',\n",
       "     'name': '中山市',\n",
       "     'center': '113.382391,22.521113',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '三角镇',\n",
       "       'center': '113.416,22.7079',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '横栏镇',\n",
       "       'center': '113.224,22.6048',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '五桂山街道',\n",
       "       'center': '113.399,22.4847',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '东升镇',\n",
       "       'center': '113.321,22.5607',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '神湾镇',\n",
       "       'center': '113.376,22.2768',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '火炬开发区街道',\n",
       "       'center': '113.42,22.5577',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '小榄镇',\n",
       "       'center': '113.23,22.7026',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '南朗镇',\n",
       "       'center': '113.482,22.519',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '古镇镇',\n",
       "       'center': '113.167,22.6751',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '民众镇',\n",
       "       'center': '113.499,22.6855',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '港口镇',\n",
       "       'center': '113.354,22.6027',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '石岐区街道',\n",
       "       'center': '113.405,22.5247',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '三乡镇',\n",
       "       'center': '113.432,22.3879',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '大涌镇',\n",
       "       'center': '113.297,22.4834',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '南头镇',\n",
       "       'center': '113.328,22.6882',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '黄圃镇',\n",
       "       'center': '113.329,22.7457',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '东区街道',\n",
       "       'center': '113.4,22.5274',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '坦洲镇',\n",
       "       'center': '113.38,22.2868',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '阜沙镇',\n",
       "       'center': '113.34,22.6406',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '西区街道',\n",
       "       'center': '113.314,22.5649',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '板芙镇',\n",
       "       'center': '113.358,22.4068',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '南区街道',\n",
       "       'center': '113.367,22.4892',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '沙溪镇',\n",
       "       'center': '113.344,22.5248',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '东凤镇',\n",
       "       'center': '113.308,22.6803',\n",
       "       'level': 'street',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0769',\n",
       "     'adcode': '441900',\n",
       "     'name': '东莞市',\n",
       "     'center': '113.746262,23.046237',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '莞城街道',\n",
       "       'center': '113.743,23.0225',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '常平镇',\n",
       "       'center': '114.036,23.0074',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '望牛墩镇',\n",
       "       'center': '113.676,23.0683',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '大朗镇',\n",
       "       'center': '113.939,22.8654',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '麻涌镇',\n",
       "       'center': '113.562,22.9718',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '黄江镇',\n",
       "       'center': '113.973,22.8121',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '东莞生态园',\n",
       "       'center': '113.917,23.0806',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '樟木头镇',\n",
       "       'center': '114.018,22.8704',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '桥头镇',\n",
       "       'center': '114.065,23.0315',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '凤岗镇',\n",
       "       'center': '114.105,22.7308',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '松山湖管委会',\n",
       "       'center': '113.875,22.869',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '寮步镇',\n",
       "       'center': '113.888,22.9529',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '石龙镇',\n",
       "       'center': '113.833,23.1123',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '高埗镇',\n",
       "       'center': '113.773,23.112',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '塘厦镇',\n",
       "       'center': '114.05,22.7713',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '谢岗镇',\n",
       "       'center': '114.128,22.9901',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '厚街镇',\n",
       "       'center': '113.776,22.9097',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '虎门镇',\n",
       "       'center': '113.797,22.8587',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '南城街道',\n",
       "       'center': '113.737,23.0249',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '虎门港管委会',\n",
       "       'center': '113.562,22.9718',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '横沥镇',\n",
       "       'center': '114.006,23.0504',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '企石镇',\n",
       "       'center': '113.99,23.0541',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '东坑镇',\n",
       "       'center': '113.918,22.995',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '东城街道',\n",
       "       'center': '113.757,23.0485',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '石排镇',\n",
       "       'center': '113.988,23.068',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '沙田镇',\n",
       "       'center': '113.582,22.9426',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '洪梅镇',\n",
       "       'center': '113.607,23.0155',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '长安镇',\n",
       "       'center': '113.708,22.7941',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '道滘镇',\n",
       "       'center': '113.692,23.004',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '大岭山镇',\n",
       "       'center': '113.843,22.9534',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '茶山镇',\n",
       "       'center': '113.839,23.0813',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '清溪镇',\n",
       "       'center': '114.11,22.862',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '石碣镇',\n",
       "       'center': '113.846,23.1024',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '中堂镇',\n",
       "       'center': '113.734,23.1164',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '万江街道',\n",
       "       'center': '113.709,23.0014',\n",
       "       'level': 'street',\n",
       "       'districts': []}]}]}]}"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 进阶方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "def xzqu(key='base',keywords='base',subdistrict=None,page=None,extensions='base',filter=None):\n",
    "    xzqy_url = \"https://restapi.amap.com/v3/config/district?parameters\"\n",
    "    params ={\n",
    "        'key':key,\n",
    "        'keywords':keywords,\n",
    "        'subdistrict':subdistrict,\n",
    "        'page':page,\n",
    "        'extensions':extensions,\n",
    "        'filter':filter\n",
    "    }\n",
    "    r = requests.get(xzqy_url,params=params)\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'suggestion': {'keywords': [], 'cities': []},\n",
       " 'districts': [{'citycode': [],\n",
       "   'adcode': '440000',\n",
       "   'name': '广东省',\n",
       "   'center': '113.280637,23.125178',\n",
       "   'level': 'province',\n",
       "   'districts': [{'citycode': '0754',\n",
       "     'adcode': '440500',\n",
       "     'name': '汕头市',\n",
       "     'center': '116.708463,23.37102',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0757',\n",
       "     'adcode': '440600',\n",
       "     'name': '佛山市',\n",
       "     'center': '113.122717,23.028762',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0758',\n",
       "     'adcode': '441200',\n",
       "     'name': '肇庆市',\n",
       "     'center': '112.472529,23.051546',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0752',\n",
       "     'adcode': '441300',\n",
       "     'name': '惠州市',\n",
       "     'center': '114.412599,23.079404',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0755',\n",
       "     'adcode': '440300',\n",
       "     'name': '深圳市',\n",
       "     'center': '114.085947,22.547',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0759',\n",
       "     'adcode': '440800',\n",
       "     'name': '湛江市',\n",
       "     'center': '110.364977,21.274898',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0756',\n",
       "     'adcode': '440400',\n",
       "     'name': '珠海市',\n",
       "     'center': '113.553986,22.224979',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0768',\n",
       "     'adcode': '445100',\n",
       "     'name': '潮州市',\n",
       "     'center': '116.632301,23.661701',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0668',\n",
       "     'adcode': '440900',\n",
       "     'name': '茂名市',\n",
       "     'center': '110.919229,21.659751',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0750',\n",
       "     'adcode': '440700',\n",
       "     'name': '江门市',\n",
       "     'center': '113.094942,22.590431',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0762',\n",
       "     'adcode': '441600',\n",
       "     'name': '河源市',\n",
       "     'center': '114.697802,23.746266',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0766',\n",
       "     'adcode': '445300',\n",
       "     'name': '云浮市',\n",
       "     'center': '112.044439,22.929801',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0660',\n",
       "     'adcode': '441500',\n",
       "     'name': '汕尾市',\n",
       "     'center': '115.364238,22.774485',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0662',\n",
       "     'adcode': '441700',\n",
       "     'name': '阳江市',\n",
       "     'center': '111.975107,21.859222',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0663',\n",
       "     'adcode': '445200',\n",
       "     'name': '揭阳市',\n",
       "     'center': '116.355733,23.543778',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0753',\n",
       "     'adcode': '441400',\n",
       "     'name': '梅州市',\n",
       "     'center': '116.117582,24.299112',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '020',\n",
       "     'adcode': '440100',\n",
       "     'name': '广州市',\n",
       "     'center': '113.280637,23.125178',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0751',\n",
       "     'adcode': '440200',\n",
       "     'name': '韶关市',\n",
       "     'center': '113.591544,24.801322',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0763',\n",
       "     'adcode': '441800',\n",
       "     'name': '清远市',\n",
       "     'center': '113.051227,23.685022',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0760',\n",
       "     'adcode': '442000',\n",
       "     'name': '中山市',\n",
       "     'center': '113.382391,22.521113',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0769',\n",
       "     'adcode': '441900',\n",
       "     'name': '东莞市',\n",
       "     'center': '113.746262,23.046237',\n",
       "     'level': 'city',\n",
       "     'districts': []}]}]}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xzqu(key,'广东')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 搜索POI"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 适用场景\n",
    "> * 关键字搜索：通过用POI的关键字进行条件搜索，例如：肯德基、朝阳公园等；同时支持设置POI类型搜索，例如：银行\n",
    "> * 周边搜索：在用户传入经纬度坐标点附近，在设定的范围内，按照关键字或POI类型搜索；\n",
    "> * 多边形搜索：在多边形区域内进行搜索"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> * 1、url:https://restapi.amap.com/v3/place/text?parameters    \n",
    "> * 2、requests.get()\n",
    "> * 3、参数：\n",
    "\n",
    ">> * A.必选：key，keywords,types\n",
    ">> * B.可选：citylimit，children，offset，extensions\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 关键字搜索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [],
   "source": [
    "def POI01(key='base',keywords='base',types=None,city=None,extensions='all',citylimit=None,children=None,offset=None,page=None):\n",
    "    POI01_url = \"https://restapi.amap.com/v3/place/text?parameters\"\n",
    "    params ={\n",
    "        'key':key,\n",
    "        'keywords':keywords,\n",
    "        'types':types,\n",
    "        'city':city,\n",
    "        'children':children,\n",
    "        'offset':offset,\n",
    "        'page':page,\n",
    "        'extensions':extensions\n",
    "    }\n",
    "    r = requests.get(POI01_url,params=params)\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '892',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '5.0'},\n",
       "   'recommend': '3',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ad5f399528ecc5928cdae0691aadf0d5'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/179e616f7547d931de33dec835224fa3'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/3dde175d0a4e2a6f84d1c27b8c0404bb'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729402',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': 'PKU|北京大学燕园校区|北大',\n",
       "   'tel': '010-62752114;010-62755110',\n",
       "   'id': 'B000A816R6',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.315761,39.990097',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 06:51:53',\n",
       "   'website': 'www.pku.edu.cn',\n",
       "   'address': '颐和园路5号',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学',\n",
       "   'location': '116.310905,39.992806',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_500002',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '5.0'},\n",
       "   'recommend': '3',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/91cafaf144e7da1fd670fe9f7b2a38bf'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/43df2b967819bd29c7abd73b33e1af85'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53ba2fc8a310502a4d0f382c'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916728802',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-62091114;010-82802191',\n",
       "   'id': 'B000A7CDQ4',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.353844,39.984167',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 19:22:29',\n",
       "   'website': [],\n",
       "   'address': '学院路38号',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': '100191',\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学医学部',\n",
       "   'location': '116.357787,39.984798',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_9888',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '3',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': '内景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/09359a7a83d4dfba3c50aa70bef22146'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/0a1ab82ace5131ea899c5fac9ca40b5d'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/57531773c9f82c335cc4605d48932c97'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '6016219511',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '昌平区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-89748044',\n",
       "   'id': 'B000A7ORQI',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.193161,40.244939',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-01 10:12:29',\n",
       "   'website': [],\n",
       "   'address': '十三陵镇西山口村',\n",
       "   'adcode': '110114',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': '102249',\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学昌平校区',\n",
       "   'location': '116.189912,40.247449',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'K50F046018_673',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '3.5'},\n",
       "   'recommend': '3',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a081a610f5a19a9b69203d77e10fd0ec'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/842cf58af51ba6f52eee557cb4211889'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ab2eb5f4bab8c645ac35783314330608'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '6016021521',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': '北京大学海淀高等职业教育学院',\n",
       "   'tel': '010-62557901',\n",
       "   'id': 'B000A7ORTV',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.317781,40.014998',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 13:03:00',\n",
       "   'website': [],\n",
       "   'address': '中关村北大街47号北京大学圆明园校区9-10号楼',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': '100084',\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(圆明园校区)',\n",
       "   'location': '116.317653,40.015178',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'K50F048019_259496',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '3',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': '外景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/640e2cfc7fdc93fb7a9e6deb38dff229'},\n",
       "    {'title': '外景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/c9e9de79ec4e770f61a3201c6a49c2aa'},\n",
       "    {'title': '外景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/db872a7f0196e2c469dbf69d10ff9c3e'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916521801',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '大兴区',\n",
       "   'children': [],\n",
       "   'alias': '北京大学软件与微电子学院',\n",
       "   'tel': '010-61273514;010-61273672',\n",
       "   'id': 'B000A7ORS7',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.356671,39.759147',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-02 22:20:09',\n",
       "   'website': [],\n",
       "   'address': '金苑路24号北京大学软件与微电子学院',\n",
       "   'adcode': '110115',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': '清源',\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学软件与微电子学院大兴校区',\n",
       "   'location': '116.357061,39.758463',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F003019_6730',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53bb4e66a310502a4d10744f'},\n",
       "    {'title': [],\n",
       "     'url': 'http://aos-cdn-image.amap.com/sns/ugccomment/f714bcba-b1b8-4e0d-8786-cfe5e4a3309f.jpg'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729500',\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFFNB9FY',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 12:53:31',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '101',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(东门)',\n",
       "   'location': '116.315575,39.9921',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_17364',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/1c2afcc70d4909d4a339d264b62b8caf'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ac10cd217b0e3015ad03b5eb562fb00c'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a04b2916e008e39863e26568c8f2f03e'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729411',\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B000A9JU6Z',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-10 10:13:37',\n",
       "   'website': [],\n",
       "   'address': '颐和园路',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '101',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(西门)',\n",
       "   'location': '116.304562,39.994557',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53bb4e66a310502a4d107457'},\n",
       "    {'title': [],\n",
       "     'url': 'http://aos-cdn-image.amap.com/sns/ugccomment/9e083d5c-5895-451b-b857-6410c622d6a9.jpg'},\n",
       "    {'title': [],\n",
       "     'url': 'http://aos-cdn-image.amap.com/sns/ugccomment/8410f19f-e867-405c-81e9-2b404861a664.jpg'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916728520',\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B000A7XYYX',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-09 23:57:12',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号北京大学',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '101',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(东南门)',\n",
       "   'location': '116.315693,39.990101',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_17365',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916728411',\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B000A87IZ5',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.305451,39.987578',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-10-28 08:03:27',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号北京大学',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '101',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(西南门)',\n",
       "   'location': '116.305632,39.987593',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5a7c4ffa3dbfb1a947df0b84de1b7b3d'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5382d884a310b9502c0d204e'},\n",
       "    {'title': '内景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/3f4ab51ae688ef027d473f10c756a99c'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729500',\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFFDC2VL',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-10-28 03:15:13',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号北京大学',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '101',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(东侧门)',\n",
       "   'location': '116.31548,39.993051',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_35100;348769',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A7CDQ4',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53ba2fc6a310502a4d0f3640'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916728801',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-82801500',\n",
       "   'id': 'B000A85D0N',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.358171,39.983717',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-04 05:12:05',\n",
       "   'website': [],\n",
       "   'address': '学院路38号北京大学医学部',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '309',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学药学院',\n",
       "   'location': '116.357670,39.983662',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_277949',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [{'title': '内景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/cb0b8fa1d8e775131378c8d42fe95f0e'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5b306d8ce81af2426ff320069121f0dc'},\n",
       "    {'title': '外景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/72352ab30534b2cad8aca97cce7ad67e'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729401',\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B000A805DO',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-13 09:22:07',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号北京大学',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '101',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(西侧门)',\n",
       "   'location': '116.304703,39.992929',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_263799;348778',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [{'title': '外景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/2950495dd8ec009cb2a81eb8b1b0bafc'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53bb4e67a310502a4d1079bd'},\n",
       "    {'title': '外景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5ca2e77d2b6c30d7a9a308a4e479d067'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916728412',\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B000A7VMCM',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-10 09:18:45',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '101',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(南门)',\n",
       "   'location': '116.311541,39.986546',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_493123',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729510',\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFFDCFGM',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.313105,39.997118',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-10-31 01:39:21',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号北京大学经济学院附近',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '101',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(北2门)',\n",
       "   'location': '116.31308,39.997069',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_348764',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729510',\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFFDC2VE',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-10 06:10:24',\n",
       "   'website': [],\n",
       "   'address': '中关村北大街133号附近',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '101',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学(东5门)',\n",
       "   'location': '116.315089,39.995278',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;学校;学校',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/52c7ffc5cb53403b13c0becb46efb2ad'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/dc4c0ef907db7870161b0dbaa910a606'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5382d87da310b9502c0d1bb0'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729402',\n",
       "   'typecode': '141200',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B000A7YZYL',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.312324,39.992919',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-10-28 04:08:08',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号北京大学',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '309',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学遥感楼',\n",
       "   'location': '116.31245,39.993175',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_35094',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53a3a2d8a310b133764f7d3a'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916728422',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFFDCEQT',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.310538,39.991105',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-06 04:57:38',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号北京大学',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '309',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学哲学楼',\n",
       "   'location': '116.310614,39.990924',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_315532',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ac72fd4bbe79ad2cb98660b89ef2ae24'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729402',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFFDC068',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-10-30 03:31:25',\n",
       "   'website': [],\n",
       "   'address': '颐和园路5号北京大学',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '309',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学-亨利楼',\n",
       "   'location': '116.311090,39.993567',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_348807;577032',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53b10edfa310a21470aca4e8'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/c6cbfc0121d8133cf429f42f7c52a07c'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53b10edfa310a21470aca4e3'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916728521',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-62751710',\n",
       "   'id': 'B000A7CKJQ',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.316801,39.991983',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-06 06:02:19',\n",
       "   'website': [],\n",
       "   'address': '成府路202号北京大学',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '309',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学化学与分子工程学院',\n",
       "   'location': '116.317343,39.991124',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_264627',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A816R6',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '4.0'},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ee2eff4f8e3ef5b24bdcf496f11f0ab1'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53a3c636a31013cc726b6d5c'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5aba836ffe6b3270b60c11ff1e763fb1'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916729501',\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '海淀区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-62751732',\n",
       "   'id': 'B000A85CAQ',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.318299,39.992493',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-10 03:13:29',\n",
       "   'website': [],\n",
       "   'address': '成府路209号',\n",
       "   'adcode': '110108',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '309',\n",
       "   'exit_location': [],\n",
       "   'name': '北京大学物理学院',\n",
       "   'location': '116.317166,39.993195',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001019_280344',\n",
       "   'groupbuy_num': '0'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "POI(key,'北京大学')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 周边搜索"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> * 1、url:https://restapi.amap.com/v3/place/around?parameters    \n",
    "> * 2、requests.get()\n",
    "> * 3、参数：\n",
    "\n",
    ">> * A.必选：key，location，keywords,types\n",
    ">> * B.可选：city，radius，sortrule，offset，extensions\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "def POI02(key='base',location='base',keywords='base',types=None,radius=None,extensions='all',offset=None,page=None):\n",
    "    POI02_url = \"https://restapi.amap.com/v3/place/around?parameters\"\n",
    "    params ={\n",
    "        'key':key,\n",
    "        'keywords':keywords,\n",
    "        'types':types,\n",
    "        'location':location,\n",
    "        'radius':radius,\n",
    "        'offset':offset,\n",
    "        'page':page,\n",
    "        'extensions':extensions\n",
    "    }\n",
    "    r = requests.get(POI02_url,params=params)\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '53',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': 'B0FFFAB6J2',\n",
       "   'distance': '4',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '82.00', 'rating': '4.5', 'meal_ordering': '0'},\n",
       "   'recommend': '0',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/c30c9d3f4d120f1469a43795792c56d6'},\n",
       "    {'title': '菜品',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/e5c12be42085679f1c5f346687066252'},\n",
       "    {'title': '菜品',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/f4ad6f4093dc59328a4b05e5eed3b65f'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916739702',\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-84722398;13716293195',\n",
       "   'id': 'B0FFLIT67S',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 14:39:55',\n",
       "   'website': [],\n",
       "   'address': '阜荣街首开广场悦食里B1',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '202',\n",
       "   'exit_location': [],\n",
       "   'name': '聚点串吧(首开广场店)',\n",
       "   'location': '116.473195,39.992983',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B0FFG4VYW6',\n",
       "   'distance': '400',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;科研机构;科研机构',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916739711',\n",
       "   'typecode': '141300',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-64754732',\n",
       "   'id': 'B000A9YNQF',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-10-21 15:30:47',\n",
       "   'website': [],\n",
       "   'address': '望京西园425号楼',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '202',\n",
       "   'exit_location': [],\n",
       "   'name': '北京国际城市发展研究院国际社区研究基地',\n",
       "   'location': '116.468907,39.994535',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B0FFG4VYW6',\n",
       "   'distance': '400',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '政府机构及社会团体;政府及社会团体相关;政府及社会团体相关',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/cf154e4f0adf6a73c5bc103d93198d52'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ae3351bb9510b4e5267e408d656e0994'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/0d6796bbfd71d729103ae358fd543e3b'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916739711',\n",
       "   'typecode': '130000',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-64754732',\n",
       "   'id': 'B000A9T7AC',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-13 01:29:46',\n",
       "   'website': [],\n",
       "   'address': '望京开发街道望京西园425号楼',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '202',\n",
       "   'exit_location': [],\n",
       "   'name': '中国职业安全健康协会安全社区课题基地',\n",
       "   'location': '116.468907,39.994535',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '746',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '商务住宅;产业园区;产业园区',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916739721',\n",
       "   'typecode': '120100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFH17DEV',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.467321,39.997725',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-10-30 23:52:56',\n",
       "   'website': [],\n",
       "   'address': '湖光中街1号',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '朝阳海外学人创新创业基地',\n",
       "   'location': '116.466990,39.997768',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '817',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '4.0'},\n",
       "   'recommend': '0',\n",
       "   'type': '体育休闲服务;体育休闲服务场所;体育休闲服务场所',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/cb80ebb16015cfa9c4604bf16216fa7e'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5d9402f3d74c0a7abcbd203ce859143b'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/9b85c3d5a2d83ec100f65254dbabf67b'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916739811',\n",
       "   'typecode': '080000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '15822249514',\n",
       "   'id': 'B0FFJDPBDF',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-09-16 16:15:35',\n",
       "   'website': [],\n",
       "   'address': [],\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '唆了蜜团建拓展轰趴基地(望京店)',\n",
       "   'location': '116.481514,39.996628',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '850',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '4.0'},\n",
       "   'recommend': '0',\n",
       "   'type': '购物服务;花鸟鱼虫市场;宠物市场',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916738821',\n",
       "   'typecode': '060502',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '15911088653',\n",
       "   'id': 'B0G3MR43ZB',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-10-20 10:27:39',\n",
       "   'website': [],\n",
       "   'address': '阜通东大街6号方恒购物中心内',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '御皇猫狗专卖基地直营(方恒购物中心店)',\n",
       "   'location': '116.482470,39.990270',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A838XY',\n",
       "   'distance': '857',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '5.0'},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;培训机构;培训机构',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/f2b819e1e45f9bbc4e1d344bf32a7c9b'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/1f945f63175271f4c9f50470d377895d'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/1ed0e94041765ad6f9cf331e6a195c5b'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916738821',\n",
       "   'typecode': '141400',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '13366747547;13521476774',\n",
       "   'id': 'B0FFHBCGX5',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.480965,39.98923',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 04:22:55',\n",
       "   'website': [],\n",
       "   'address': '阜通东大街6号院702望京小街方恒购物中心5层',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '202',\n",
       "   'exit_location': [],\n",
       "   'name': '阳光游泳培训基地(望京方恒店)',\n",
       "   'location': '116.483390,39.991052',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A838XY',\n",
       "   'distance': '898',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/67e15c6d16cdc2f6d6702e0bd1b20e1a'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/775fe94e388bc4e24e8391f8550b630c'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/593032863a7af7ff3a0d72286c2b282e'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916738822',\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '13366747547;13521476774',\n",
       "   'id': 'B0FFJ2A0W8',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-14 09:36:56',\n",
       "   'website': [],\n",
       "   'address': '阜通东大街6号院702望京小街方恒购物中心5层',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '202',\n",
       "   'exit_location': [],\n",
       "   'name': '阳光游泳培训基地(望京方恒站)',\n",
       "   'location': '116.483390,39.991052',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '1023',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '公司企业;公司企业;公司企业',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916738801',\n",
       "   'typecode': '170000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFIBCEK8',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-09-17 22:09:42',\n",
       "   'website': [],\n",
       "   'address': '索尼大厦17层',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '开PA大本营',\n",
       "   'location': '116.481067,39.986092',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '1168',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '政府机构及社会团体;政府及社会团体相关;政府及社会团体相关',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/e37fd158fe5f0dc08d5244c7e866534a'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916737722',\n",
       "   'typecode': '130000',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFHZTAUS',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-13 11:33:08',\n",
       "   'website': [],\n",
       "   'address': '阜通东大街24附近',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '国家中医药管理局中医急诊临床基地建设单位',\n",
       "   'location': '116.471426,39.982605',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '1177',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '8768.00', 'rating': '4.0'},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;培训机构;培训机构',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/044ddc65b9bfe1f15ecbe306d0c486d0'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/0675a1ac00d0b6608cf6b6d60035c71a'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/18f55a5a0ac7a8b07f493e63276dedba'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '6016030700',\n",
       "   'typecode': '141400',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '13581608839;18810818397',\n",
       "   'id': 'B0FFJ1OI65',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 10:00:58',\n",
       "   'website': [],\n",
       "   'address': '广顺北大街19号六佰本商业街南区2层',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '缤纷鸟少儿美术基地(望京校区)',\n",
       "   'location': '116.466829,40.002060',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A81FIR',\n",
       "   'distance': '1286',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;学校;成人教育',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53ab7ba4a3106c892e6e1456'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/2f44f5490468f8bd34debfcc9a506da4'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916737820',\n",
       "   'typecode': '141205',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-84778304',\n",
       "   'id': 'B000A843DC',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.475464,39.981837',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-05 02:48:32',\n",
       "   'website': [],\n",
       "   'address': '花家地街9号院',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '309',\n",
       "   'exit_location': [],\n",
       "   'name': '北京青年政治学院教学实训基地',\n",
       "   'location': '116.475012,39.981541',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001020_145774',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A87TRZ',\n",
       "   'distance': '1287',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '96.00', 'rating': '4.5', 'meal_ordering': '0'},\n",
       "   'recommend': '0',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/70843c5a12d7be33cbf894fd84da0aa0'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/4d37b76dfc7d32794ee848c98c039170'},\n",
       "    {'title': '菜品',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/e5c12be42085679f1c5f346687066252'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '6016030700',\n",
       "   'typecode': '050118',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-67506667;18911816989',\n",
       "   'id': 'B0FFKH89KO',\n",
       "   'tag': '爆香小嫩牛,羊肉串,铁板煎嫩豆腐,泰式蜜汁鸡翅,聚点霸王串,朝鲜冷面,老北京疙瘩汤,黄金鸡脆骨,内蒙羔羊肉串,望京小腰,锡纸金针菇,炒方便面,烤串,蒜爆鸡,烤面包片,鱼豆腐,牛蹄筋,特色豆腐卷,铁板鱿鱼,大拌菜,嫩牛肉,牛肉串,烤茄子,蜜汁排骨,板筋',\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 03:28:45',\n",
       "   'website': [],\n",
       "   'address': '湖光北街9号望京旺角购物广场1层',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '202',\n",
       "   'exit_location': [],\n",
       "   'name': '聚点串吧(望京旺角店)',\n",
       "   'location': '116.463364,40.001813',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '1321',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916737820',\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFI9NHZA',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-12 19:24:08',\n",
       "   'website': [],\n",
       "   'address': '花家地东路与花家地街交叉口西50米',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '朝阳区中小学生职业体验基地',\n",
       "   'location': '116.475589,39.981699',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '1392',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '137.00', 'rating': '4.4', 'meal_ordering': '0'},\n",
       "   'recommend': '0',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/de3186f69732ce46ae8aa85ea8032fdd'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/b889e9ab6df1b25812b6a77f76abf5e1'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/096a4211d5e4c7bf4d5b09406686c4e9'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '6016030712',\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '13718485004',\n",
       "   'id': 'B0GU2RFVC3',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-14 14:57:29',\n",
       "   'website': [],\n",
       "   'address': '河荫中路东二号',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '濠丰基地小龙虾',\n",
       "   'location': '116.471924,40.005487',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '1448',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '公司企业;公司;公司',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '6016030802',\n",
       "   'typecode': '170200',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFLNWN61',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.486377,40.001183',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-02 20:36:15',\n",
       "   'website': [],\n",
       "   'address': '望京绿地中心B座商业街B1层210B',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '金赋股份创业孵化基地',\n",
       "   'location': '116.486856,40.000726',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B000A9E2IR',\n",
       "   'distance': '1580',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '政府机构及社会团体;社会团体;社会团体相关',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916737710',\n",
       "   'typecode': '130400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFFAHCLD',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-09-18 03:16:41',\n",
       "   'website': [],\n",
       "   'address': '方舟苑2号',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '202',\n",
       "   'exit_location': [],\n",
       "   'name': '方舟苑社区青少年志愿者活动基地',\n",
       "   'location': '116.465591,39.980058',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001020_344533',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '1630',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916738621',\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFHZU8ED',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-10 11:26:47',\n",
       "   'website': [],\n",
       "   'address': '西园南路503-506号楼1层附近',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '名师屋时尚艺术教育实践基地',\n",
       "   'location': '116.454612,39.989494',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '1694',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916737711',\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFLPA0C8',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-04 21:13:09',\n",
       "   'website': [],\n",
       "   'address': '花家地南街',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '朝阳区高技能人才培养基地',\n",
       "   'location': '116.469617,39.978043',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': [],\n",
       "   'distance': '1702',\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916737711',\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFHWFSDY',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-10 06:30:23',\n",
       "   'website': [],\n",
       "   'address': '北四环东路甲7号附近',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '北京市园林学校实训基地',\n",
       "   'location': '116.469716,39.977948',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "POI02(key,'116.473168,39.993015')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  多边形搜索\n",
    "> * 1、url:https://restapi.amap.com/v3/place/polygon?parameters    \n",
    "> * 2、requests.get()\n",
    "> * 3、参数：\n",
    "\n",
    ">> * A.必选：key，polygon，keywords,types\n",
    ">> * B.可选：offset，extensions，types"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "def POI03(key='base',polygon='base',keywords='base',types=None,extensions='all',offset=None,page=None):\n",
    "    POI03_url = \"https://restapi.amap.com/v3/place/polygon?parameters\"\n",
    "    params ={\n",
    "        'key':key,\n",
    "        'keywords':keywords,\n",
    "        'types':types,\n",
    "        'polygon':polygon,\n",
    "        'offset':offset,\n",
    "        'page':page,\n",
    "        'extensions':extensions\n",
    "    }\n",
    "    r = requests.get(POI03_url,params=params)\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '3',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '41.00', 'rating': '4.2', 'meal_ordering': '0'},\n",
       "   'recommend': '0',\n",
       "   'type': '餐饮服务;快餐厅;肯德基',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/3128f7ff352252647828f2cd0c182595'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/80025d84d06dcd5f469447b38884cb36'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/19052eb9143e5a21b9abe93d033ed9c5'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916739722',\n",
       "   'typecode': '050301',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '17810627435;4009208801',\n",
       "   'id': 'B0FFKEPXS2',\n",
       "   'tag': '香辣鸡腿堡ST,劲爆鸡米花,新奥尔良烤鸡腿堡ST,波纹霸王薯条,超级外送全家桶ST,葡式蛋挞经典装,培根鸡腿重磅肉霸堡,劲脆鸡腿堡ST,咸蛋黄流心可颂,皮蛋瘦肉粥,吮指原味鸡,香辣鸡翅,六味小吃桶,香辣黄金鸡柳,黄金鸡块装,新奥尔良烤翅,原味圣代,猫山王榴莲花筒,九龙金玉醇香乌龙奶茶,重磅肉霸堡双人餐,精选炸鸡啤酒超级桶,重磅双层鸡排堡,新堡堡蜘蛛侠双人餐,新堡堡双人餐,芝士厚菇素尊堡',\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 05:40:47',\n",
       "   'website': [],\n",
       "   'address': '望京西园4区410号综合楼1层',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': [],\n",
       "   'exit_location': [],\n",
       "   'name': '肯德基(望京西店)',\n",
       "   'location': '116.474027,39.997731',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B0FFG4VQTD',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '43.00', 'rating': '4.5', 'meal_ordering': '0'},\n",
       "   'recommend': '0',\n",
       "   'type': '餐饮服务;快餐厅;肯德基',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/3128f7ff352252647828f2cd0c182595'},\n",
       "    {'title': '香辣鸡腿堡',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/aff3c644629ee9e3502589915f471c35'},\n",
       "    {'title': '新奥尔良烤翅',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/55fe83c00e1ee57f5030f38dd07fe7ec'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '6016030700',\n",
       "   'typecode': '050301',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '010-64753305;4009208801;010-64753306',\n",
       "   'id': 'B000A7FVJQ',\n",
       "   'tag': '香辣鸡腿堡,新奥尔良烤翅,皮蛋瘦肉粥,牛油果热辣藤椒鸡超级塔可,蛋挞,金沙咸蛋黄香辣鸡翅,五味小食拼盘,薯条,醇香土豆泥,大鸡腿饭,冰淇淋,中薯,豆浆,香辣翅,油条,嫩牛五方,炸鸡,拿铁,红豆酒酿,脏脏大虾鸡腿堡,巧克力圣代冰淇凌,老北京鸡肉卷,肯德基避风塘大虾鸡腿双层堡,玉米汁,薯饼',\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 11:11:54',\n",
       "   'website': [],\n",
       "   'address': '望京南湖东园201号楼1层',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '202',\n",
       "   'exit_location': [],\n",
       "   'name': '肯德基(中福百货店)',\n",
       "   'location': '116.463373,40.000423',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001020_223840',\n",
       "   'groupbuy_num': '0'},\n",
       "  {'parent': 'B0FFF5UV26',\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': '41.00', 'rating': '4.5', 'meal_ordering': '0'},\n",
       "   'recommend': '0',\n",
       "   'type': '餐饮服务;快餐厅;肯德基',\n",
       "   'photos': [{'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/3128f7ff352252647828f2cd0c182595'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5adc19aa58cf8ba9245e7cb826d95ab3'},\n",
       "    {'title': '菜品',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/8ed35a41bebfc69449f1fca61e20e618'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916738701',\n",
       "   'typecode': '050301',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'children': [],\n",
       "   'alias': [],\n",
       "   'tel': '4009200715',\n",
       "   'id': 'B000A7BM4H',\n",
       "   'tag': '原味吮指鸡,炸薯条,藜麦蛋挞拿铁沙啦餐T,吮指原味鸡T,香辣鸡腿堡S豆泥餐T,全家桶套餐,金沙咸蛋黄香辣鸡翅,葡式蛋挞T,香草风味冰拿铁,奥堡辣翅荟蔬汤餐,十三鲜小龙虾烤鸡堡T,香辣鸡腿堡STN,葡式蛋挞经典装,藤椒肯大大鸡排,老北京鸡肉卷,新奥尔良烤翅,北海道冰淇淋,超级塔可,牛油果鸡肉超级塔可T,醇香土豆泥T,培根饭团热浆春卷餐,猪柳蛋帕尼S拿铁薯,馋嘴巴香辣鸡翅尖,塔可青年单人餐,塔可双人经典餐',\n",
       "   'event': [],\n",
       "   'entr_location': '116.469414,39.985729',\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-16 17:57:10',\n",
       "   'website': [],\n",
       "   'address': '花家地小区1号商业楼',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'indoor_data': {'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'business_area': '望京',\n",
       "   'childtype': '202',\n",
       "   'exit_location': [],\n",
       "   'name': '肯德基(花家地店)',\n",
       "   'location': '116.469263,39.985284',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001020_425283',\n",
       "   'groupbuy_num': '0'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "POI03(key,'116.460988,40.006919|116.48231,40.007381;116.47516,39.99713|116.472596,39.985227|116.45669,39.984989|116.460988,40.006919','肯德基')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### IP定位\n",
    "> * 功能：能够将IP信息转换为地理位置信息。\n",
    "> * A.url : https://restapi.amap.com/v3/ip?parameters    \n",
    "> * B.requests.get()    \n",
    "> * C.参数：    \n",
    "\n",
    ">> * 1、必选：key,ip(不填则取客户HTTP之中的请求来进行定位）\n",
    ">> * 2、可选:info,province,infocode,city,adcode,rectangle [(默认：base)可选\"all\"描述数据详细指数,\"None\"默认值]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "def ipya(key=\"base\",ip=None,info=None,status=None,province=None,infocode=None,city=None,adcode=None,rectangle=None):\n",
    "  \n",
    "    url = 'https://restapi.amap.com/v3/ip?parameters'\n",
    "    params = {\n",
    "    'key':key,\n",
    "    'ip':ip,\n",
    "    'status':status,\n",
    "    'info':info,\n",
    "    'infocode':infocode,\n",
    "    'province':province,\n",
    "    'city':city,\n",
    "    'adcode':adcode,\n",
    "    'rectangle':rectangle\n",
    "    \n",
    "  \n",
    "}\n",
    "    r = requests.get(url,params)\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'province': '广东省',\n",
       " 'city': '广州市',\n",
       " 'adcode': '440100',\n",
       " 'rectangle': '113.1017375,22.93212254;113.6770499,23.3809537'}"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ipya(key)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 批量请求接口\n",
    "> * 功能：静态地图服务通过返回一张地图图片响应HTTP请求，使用户能够将高德地图以图片形式嵌入自己的网页中。用户可以指定请求的地图位置、图片大小、以及在地图上添加覆盖物，如标签、标注、折线、多边形。\n",
    "> * A.url : https://restapi.amap.com/v3/staticmap?parameters\n",
    "> * B.requests.get()    \n",
    "> * C.参数：    \n",
    "\n",
    ">> * 1、必选：key,location，zoom，\n",
    ">> * 2、可选:size,scale,markers,labels,paths,traffic\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 静态地图\n",
    "> * 功能：静态地图服务通过返回一张地图图片响应HTTP请求，使用户能够将高德地图以图片形式嵌入自己的网页中。用户可以指定请求的地图位置、图片大小、以及在地图上添加覆盖物，如标签、标注、折线、多边形。\n",
    "> * A.url : https://restapi.amap.com/v3/staticmap?parameters\n",
    "> * B.requests.get()    \n",
    "> * C.参数：    \n",
    "\n",
    ">> * 1、必选：key,location，zoom，\n",
    ">> * 2、可选:size,scale,markers,labels,paths,traffic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [],
   "source": [
    "origin_location = 113.679287,23.632575"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import json\n",
    "from PIL import Image\n",
    "from io import BytesIO"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {},
   "outputs": [],
   "source": [
    "#r = requests.get()\n",
    "#results = Image.open(r.content())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(113.679287, 23.632575)"
      ]
     },
     "execution_count": 171,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "origin_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {},
   "outputs": [],
   "source": [
    "def jtdt(key=\"base\",location=None,zoom=None,size=None,scale=None,markers=None,labels=None,paths=None,traffic=None):\n",
    "  \n",
    "    url = 'https://restapi.amap.com/v3/staticmap?parameters'\n",
    "    params = {\n",
    "    'key':key,\n",
    "    'location':location,\n",
    "    'zoom':zoom,\n",
    "    'size':size,\n",
    "    'scale':scale,\n",
    "    'markers':markers,\n",
    "    'labels':labels,\n",
    "    'paths':paths,\n",
    "    'traffic':traffic\n",
    "  \n",
    "}\n",
    "    r = requests.get(url,params=params)\n",
    "    results = Image.open(BytesIO(r.content))\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAADAFBMVEXg3dnd2M19urr18eqNj5Hs7Oz59/H78dt4eXvX6Pze2c/LbDmioJy5urqpqarY2Nk0jcB/gYPVwK729PH59uuLj5F4eHh8e3ppaWns6eSGhobf6fjv7uzo3NLx8vPD1efCrZnNy8a3rqJ0dXi5vLrx8fqcfmKIkdlgYmSxsLD39/WWoJSlp6jBu7K9tKr29OvOx7/Z5PXw7Ojl4+D+/PukpKWglousq6q/v8B5e333/OHp5+Hb0MZ/UCfh39u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PngImageFile image mode=P size=400x400 at 0x1EDDA23F5E0>"
      ]
     },
     "execution_count": 202,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "jtdt(key,'113.271191,22.779995')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 坐标转换\n",
    "> * 功能：为了使用高德服务，用户需要将非高德坐标转换为高德坐标。\n",
    "> * A.url : https://restapi.amap.com/v3/assistant/coordinate/convert?parameters\n",
    "> * B.requests.get()    \n",
    "> * C.参数：    \n",
    "\n",
    ">> * 1、必选：key,location\n",
    ">> * 2、可选:coordsys,sig,\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {},
   "outputs": [],
   "source": [
    "def zbzh(key='base',location='base',coordsys=None,info=None,sig=None,output=\"json\"):\n",
    "  \n",
    "    url = 'https://restapi.amap.com/v3/assistant/coordinate/convert?parameters'\n",
    "    params = {\n",
    "    'key':key,\n",
    "    'location':location,\n",
    "    'coordsys':coordsys,\n",
    "    'info':info\n",
    "  \n",
    "}\n",
    "    r = requests.get(url,params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '0', 'info': 'MISSING_REQUIRED_PARAMS', 'infocode': '20001'}"
      ]
     },
     "execution_count": 186,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "zbzh(key,'113.271191,22.779995|113.292382,22.818665')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 187,
   "metadata": {},
   "outputs": [],
   "source": [
    "def zbzh(key,coordinate_convert_location,coordsys=\"autonavi\",sig=None,output=\"json\"):\n",
    "    \"\"\"将用户输入的非高德坐标（GPS坐标、mapbar坐标、baidu坐标）转换成高德坐标\"\"\"\n",
    "    coordinate_convert_url = \"https://restapi.amap.com/v3/assistant/coordinate/convert?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"locations\":coordinate_convert_location,\n",
    "        \"coordsys\":coordsys,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output\n",
    "    }\n",
    "    r = requests.get(coordinate_convert_url,params=params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 188,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'ok',\n",
       " 'infocode': '10000',\n",
       " 'locations': '113.271191,22.779995|113.292382,22.818665'}"
      ]
     },
     "execution_count": 188,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "zbzh(key,'113.271191,22.779995|113.292382,22.818665')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 天气查询\n",
    "> * 功能：需要使用相关天气查询的时候。\n",
    "> * A.url : https://restapi.amap.com/v3/weather/weatherInfo?parameters\n",
    "> * B.requests.get()    \n",
    "> * C.参数：    \n",
    "\n",
    ">> * 1、必选：key,city\n",
    ">> * 2、可选:extensions,output"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "metadata": {},
   "outputs": [],
   "source": [
    "def weather(key,city,extension=\"all\",output=\"json\"):\n",
    "    \"\"\"根据用户输入的adcode，查询目标区域当前/未来的天气情况\"\"\"\n",
    "    weather_url = \"https://restapi.amap.com/v3/weather/weatherInfo?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"city\":city,\n",
    "        \"extensions\":extension,\n",
    "        \"output\":output\n",
    "    }\n",
    "    r = requests.get(weather_url,params=params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 191,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'count': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'forecasts': [{'city': '揭阳市',\n",
       "   'adcode': '445200',\n",
       "   'province': '广东',\n",
       "   'reporttime': '2020-11-17 01:22:33',\n",
       "   'casts': [{'date': '2020-11-17',\n",
       "     'week': '2',\n",
       "     'dayweather': '多云',\n",
       "     'nightweather': '多云',\n",
       "     'daytemp': '28',\n",
       "     'nighttemp': '20',\n",
       "     'daywind': '北',\n",
       "     'nightwind': '北',\n",
       "     'daypower': '≤3',\n",
       "     'nightpower': '≤3'},\n",
       "    {'date': '2020-11-18',\n",
       "     'week': '3',\n",
       "     'dayweather': '阴',\n",
       "     'nightweather': '阵雨',\n",
       "     'daytemp': '28',\n",
       "     'nighttemp': '21',\n",
       "     'daywind': '北',\n",
       "     'nightwind': '北',\n",
       "     'daypower': '≤3',\n",
       "     'nightpower': '≤3'},\n",
       "    {'date': '2020-11-19',\n",
       "     'week': '4',\n",
       "     'dayweather': '阵雨',\n",
       "     'nightweather': '多云',\n",
       "     'daytemp': '27',\n",
       "     'nighttemp': '22',\n",
       "     'daywind': '北',\n",
       "     'nightwind': '北',\n",
       "     'daypower': '≤3',\n",
       "     'nightpower': '≤3'},\n",
       "    {'date': '2020-11-20',\n",
       "     'week': '5',\n",
       "     'dayweather': '阵雨',\n",
       "     'nightweather': '阵雨',\n",
       "     'daytemp': '27',\n",
       "     'nighttemp': '21',\n",
       "     'daywind': '北',\n",
       "     'nightwind': '北',\n",
       "     'daypower': '≤3',\n",
       "     'nightpower': '≤3'}]}]}"
      ]
     },
     "execution_count": 191,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weather(key,'揭阳')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 输入提示\n",
    "> * 功能：搜索联想\n",
    "> * A.url : https://restapi.amap.com/v3/assistant/inputtips?parameters\n",
    "> * B.requests.get()    \n",
    "> * C.参数：    \n",
    "\n",
    ">> * 1、必选：key,keywords\n",
    ">> * 2、可选:type,location，city，citylimit，datatype，"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 192,
   "metadata": {},
   "outputs": [],
   "source": [
    "def inputtips(key,keyword,input_type=None,location=None,city=None,citylimit=\"false\",datatype=\"all\",sig=None,output=\"json\",callback=None):\n",
    "    \"\"\"提供根据用户输入的关键词查询返回建议列表\"\"\"\n",
    "    inputtips_url = \"https://restapi.amap.com/v3/assistant/inputtips?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"keywords\":keyword,\n",
    "        \"type\":input_type,\n",
    "        \"location\":location,\n",
    "        \"city\":city,\n",
    "        \"citylimit\":citylimit,\n",
    "        \"datatype\":datatype,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output,\n",
    "        \"callback\":callback\n",
    "    }\n",
    "    r = requests.get(inputtips_url,params=params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 193,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'count': '5',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'tips': [{'id': 'B02970NA0Z',\n",
       "   'name': '黄满磜瀑布群',\n",
       "   'district': '广东省揭阳市揭西县',\n",
       "   'adcode': '445222',\n",
       "   'location': '115.989857,23.575557',\n",
       "   'address': '京溪园镇粗坑村',\n",
       "   'typecode': '110000',\n",
       "   'city': []},\n",
       "  {'id': 'B0FFJAKHBE',\n",
       "   'name': '黄满寨瀑布群景区',\n",
       "   'district': '广东省揭阳市揭西县',\n",
       "   'adcode': '445222',\n",
       "   'location': '115.989836,23.575605',\n",
       "   'address': '粗坑村黄满寨瀑布',\n",
       "   'typecode': '110202',\n",
       "   'city': []},\n",
       "  {'id': 'B0FFI2CUT0',\n",
       "   'name': '黄满寨景区换乘中心',\n",
       "   'district': '广东省揭阳市揭西县',\n",
       "   'adcode': '445222',\n",
       "   'location': '116.043823,23.514641',\n",
       "   'address': '京溪园镇335省道旁',\n",
       "   'typecode': '150000',\n",
       "   'city': []},\n",
       "  {'id': 'B0FFKLCOBS',\n",
       "   'name': '黄满寨合作社',\n",
       "   'district': '广东省揭阳市揭西县',\n",
       "   'adcode': '445222',\n",
       "   'location': '115.986771,23.569493',\n",
       "   'address': '553乡道东50米粗坑学校附近',\n",
       "   'typecode': '130000',\n",
       "   'city': []},\n",
       "  {'id': 'B0FFK4EGO7',\n",
       "   'name': '黄满寨换乘中心',\n",
       "   'district': '广东省揭阳市揭西县',\n",
       "   'adcode': '445222',\n",
       "   'location': '116.044010,23.514691',\n",
       "   'address': '京溪园镇黄满寨',\n",
       "   'typecode': '110000',\n",
       "   'city': []}]}"
      ]
     },
     "execution_count": 193,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inputtips(key,\"黄满寨\",city=\"揭阳\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 交通态势\n",
    "> * 功能：交通态势是一类简单的HTTP接口，提供根据用户输入的内容能够返回希望查询的交通态势情况。\n",
    "> * A.url : https://restapi.amap.com/v3/traffic/status/rectangle?parameters\n",
    "> * B.requests.get()    \n",
    "> * C.参数：    \n",
    "\n",
    ">> * 1、必选：key,rectangle\n",
    ">> * 2、可选:level,extensions，sig，output，callback"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 194,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 矩形区域交通\n",
    "def traffic_rectangle(key,rectangle,level=5,extensions=\"base\",sig=None,output=\"json\",callback=None):\n",
    "    \"\"\"提供根据用户输入的内容能够返回希望查询的交通态势情况\"\"\"\n",
    "    traffic_rectangle_url = \"https://restapi.amap.com/v3/traffic/status/rectangle?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"rectangle\":rectangle,\n",
    "        \"level\":level,\n",
    "        \"extensions\":extensions,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output,\n",
    "        \"callback\":callback\n",
    "    }\n",
    "    r = requests.get(traffic_rectangle_url,params=params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 195,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'info': 'INSUFFICIENT_PRIVILEGES',\n",
       " 'infocode': '10012',\n",
       " 'status': '0',\n",
       " 'sec_code_debug': 'd41d8cd98f00b204e9800998ecf8427e',\n",
       " 'key': 'dcf6ab6ec2715890c639887ab32bfc87',\n",
       " 'sec_code': 'd41d8cd98f00b204e9800998ecf8427e'}"
      ]
     },
     "execution_count": 195,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "traffic_rectangle(key,'116.351147,39.966309;116.357134,39.968727')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 圆形区域交通态势\n",
    "\n",
    "def traffic_circle(key,traffic_circle_location,level=5,extensions=\"base\",sig=None,output=\"json\",callback=None,radius=1000):\n",
    "    \"\"\"提供根据用户输入的内容能够返回希望查询的交通态势情况\"\"\"\n",
    "    traffic_circle_url = \"https://restapi.amap.com/v3/traffic/status/circle?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"location\":traffic_circle_location,\n",
    "        \"level\":level,\n",
    "        \"extensions\":extensions,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output,\n",
    "        \"callback\":callback,\n",
    "        \"radius\":radius\n",
    "    }\n",
    "    r = requests.get(traffic_circle_url,params=params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'info': 'INSUFFICIENT_PRIVILEGES',\n",
       " 'infocode': '10012',\n",
       " 'status': '0',\n",
       " 'sec_code_debug': 'd41d8cd98f00b204e9800998ecf8427e',\n",
       " 'key': 'dcf6ab6ec2715890c639887ab32bfc87',\n",
       " 'sec_code': 'd41d8cd98f00b204e9800998ecf8427e'}"
      ]
     },
     "execution_count": 198,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "traffic_circle(key,'113.271191,22.779995')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# 指定线路交通态势\n",
    "\n",
    "def traffic_road(key,name,city,adcode=None,level=5,extensions=\"base\",sig=None,output=\"json\",callback=None):\n",
    "    \"\"\"提供根据用户输入的内容能够返回希望查询的交通态势情况\"\"\"\n",
    "    traffic_road_url = \"https://restapi.amap.com/v3/traffic/status/road?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"name\":name,\n",
    "        \"city\":city,\n",
    "        \"adcode\":adcode,\n",
    "        \"level\":level,\n",
    "        \"extensions\":extensions,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output,\n",
    "        \"callback\":callback\n",
    "    }\n",
    "    r = requests.get(traffic_road_url,params=params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'info': 'INSUFFICIENT_PRIVILEGES',\n",
       " 'infocode': '10012',\n",
       " 'status': '0',\n",
       " 'sec_code_debug': 'd41d8cd98f00b204e9800998ecf8427e',\n",
       " 'key': 'dcf6ab6ec2715890c639887ab32bfc87',\n",
       " 'sec_code': 'd41d8cd98f00b204e9800998ecf8427e'}"
      ]
     },
     "execution_count": 200,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "traffic_road(key,'河婆街道','揭阳')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
